Commit dc7e4657 authored by Christopher A. Stelma's avatar Christopher A. Stelma

pass home down through createLink

parent 81e09ff1
......@@ -366,7 +366,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)
lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local"), out, home)
if err != nil {
return err
}
......@@ -406,7 +406,7 @@ func initStableRepo(cacheFile string, out io.Writer, skipRefresh bool, home helm
return &c, nil
}
func initLocalRepo(indexFile, cacheFile string, out io.Writer) (*repo.Entry, error) {
func initLocalRepo(indexFile, cacheFile string, out io.Writer, home helmpath.Home) (*repo.Entry, error) {
if fi, err := os.Stat(indexFile); err != nil {
fmt.Fprintf(out, "Adding %s repo with URL: %s \n", localRepository, localRepositoryURL)
i := repo.NewIndexFile()
......@@ -415,7 +415,9 @@ func initLocalRepo(indexFile, cacheFile string, out io.Writer) (*repo.Entry, err
}
//TODO: take this out and replace with helm update functionality
createLink(indexFile, cacheFile)
if err := createLink(indexFile, cacheFile, home); err != nil {
return nil, err
}
} else if fi.IsDir() {
return nil, fmt.Errorf("%s must be a file, not a directory", indexFile)
}
......
......@@ -20,8 +20,10 @@ package main
import (
"os"
"k8s.io/helm/pkg/helm/helmpath"
)
func createLink(indexFile, cacheFile string) {
os.Symlink(indexFile, cacheFile)
func createLink(indexFile, cacheFile string, home helmpath.Home) error {
return os.Symlink(indexFile, cacheFile)
}
......@@ -20,8 +20,10 @@ package main
import (
"os"
"k8s.io/helm/pkg/helm/helmpath"
)
func createLink(indexFile, cacheFile string) {
os.Link(indexFile, cacheFile)
func createLink(indexFile, cacheFile string, home helmpath.Home) error {
return os.Link(indexFile, cacheFile)
}
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