From 146b94be3b564c92a6782e8b9686bb38ceb40263 Mon Sep 17 00:00:00 2001 From: "Christopher A. Stelma" Date: Mon, 23 Oct 2017 13:42:54 -0700 Subject: [PATCH] allow cacheFile to be relative for local index --- cmd/helm/init.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index a14d945a2..e331fb5da 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -300,7 +300,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err if err != nil { return err } - lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local"), out, home) + lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.RelativeIndex("local"), out, home) if err != nil { return err } @@ -347,12 +347,12 @@ func initLocalRepo(indexFile, cacheFile string, out io.Writer, home helmpath.Hom } //TODO: take this out and replace with helm update functionality - fp, err := filepath.Rel(cacheFile, indexFile) + fp, err := filepath.Rel(filepath.Join(home.Cache(), cacheFile), indexFile) if err != nil { return nil, err } pth := home.Path(fp) - os.Symlink(pth, cacheFile) + os.Symlink(pth, filepath.Join(home.Cache(), cacheFile)) } else if fi.IsDir() { return nil, fmt.Errorf("%s must be a file, not a directory", indexFile) }