allow cacheFile to be relative for local index

pull/2862/head
Christopher A. Stelma 8 years ago
parent 2bd6940061
commit 146b94be3b

@ -300,7 +300,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err
if err != nil { if err != nil {
return err 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 { if err != nil {
return err 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 //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 { if err != nil {
return nil, err return nil, err
} }
pth := home.Path(fp) pth := home.Path(fp)
os.Symlink(pth, cacheFile) os.Symlink(pth, filepath.Join(home.Cache(), cacheFile))
} else if fi.IsDir() { } else if fi.IsDir() {
return nil, fmt.Errorf("%s must be a file, not a directory", indexFile) return nil, fmt.Errorf("%s must be a file, not a directory", indexFile)
} }

Loading…
Cancel
Save