Commit a27e2399 authored by vaikas-google's avatar vaikas-google

offset all the directories and files to $HELM_HOME/repository from $HELM_HOME

parent 5e1ef0ce
......@@ -74,7 +74,7 @@ func installTiller() error {
//
// If $HELM_HOME does not exist, this function will create it.
func ensureHome() error {
configDirectories := []string{homePath(), cacheDirectory(), localRepoDirectory()}
configDirectories := []string{homePath(), repositoryDirectory(), cacheDirectory(), localRepoDirectory()}
for _, p := range configDirectories {
if fi, err := os.Stat(p); err != nil {
......
......@@ -6,6 +6,7 @@ import (
)
const (
repositoryDir string = "repository"
repositoriesFilePath string = "repositories.yaml"
cachePath string = "cache"
localRepoPath string = "local"
......@@ -16,16 +17,21 @@ func homePath() string {
return os.ExpandEnv(helmHome)
}
// All other directories go under the $HELM_HOME/repository.
func repositoryDirectory() string {
return homePath() + "/" + repositoryDir
}
func cacheDirectory(paths ...string) string {
fragments := append([]string{homePath(), cachePath}, paths...)
fragments := append([]string{repositoryDirectory(), cachePath}, paths...)
return filepath.Join(fragments...)
}
func localRepoDirectory(paths ...string) string {
fragments := append([]string{homePath(), localRepoPath}, paths...)
fragments := append([]string{repositoryDirectory(), localRepoPath}, paths...)
return filepath.Join(fragments...)
}
func repositoriesFile() string {
return filepath.Join(homePath(), repositoriesFilePath)
return filepath.Join(repositoryDirectory(), repositoriesFilePath)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment