|
|
@ -6,6 +6,7 @@ import (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
const (
|
|
|
|
|
|
|
|
repositoryDir string = "repository"
|
|
|
|
repositoriesFilePath string = "repositories.yaml"
|
|
|
|
repositoriesFilePath string = "repositories.yaml"
|
|
|
|
cachePath string = "cache"
|
|
|
|
cachePath string = "cache"
|
|
|
|
localRepoPath string = "local"
|
|
|
|
localRepoPath string = "local"
|
|
|
@ -16,16 +17,21 @@ func homePath() string {
|
|
|
|
return os.ExpandEnv(helmHome)
|
|
|
|
return os.ExpandEnv(helmHome)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// All other directories go under the $HELM_HOME/repository.
|
|
|
|
|
|
|
|
func repositoryDirectory() string {
|
|
|
|
|
|
|
|
return homePath() + "/" + repositoryDir
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func cacheDirectory(paths ...string) string {
|
|
|
|
func cacheDirectory(paths ...string) string {
|
|
|
|
fragments := append([]string{homePath(), cachePath}, paths...)
|
|
|
|
fragments := append([]string{repositoryDirectory(), cachePath}, paths...)
|
|
|
|
return filepath.Join(fragments...)
|
|
|
|
return filepath.Join(fragments...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func localRepoDirectory(paths ...string) string {
|
|
|
|
func localRepoDirectory(paths ...string) string {
|
|
|
|
fragments := append([]string{homePath(), localRepoPath}, paths...)
|
|
|
|
fragments := append([]string{repositoryDirectory(), localRepoPath}, paths...)
|
|
|
|
return filepath.Join(fragments...)
|
|
|
|
return filepath.Join(fragments...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func repositoriesFile() string {
|
|
|
|
func repositoriesFile() string {
|
|
|
|
return filepath.Join(homePath(), repositoriesFilePath)
|
|
|
|
return filepath.Join(repositoryDirectory(), repositoriesFilePath)
|
|
|
|
}
|
|
|
|
}
|
|
|
|