and now windows

pull/3327/head
Christopher A. Stelma 8 years ago
parent e13fd19f4d
commit 15aee5d8f8

@ -23,7 +23,6 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
@ -392,11 +391,9 @@ 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(home.Cache(), indexFile)
if err != nil {
if err := createLink(indexFile, cacheFile, home); err != nil {
return nil, err
}
createLink(fp, filepath.Join(home.Cache(), cacheFile))
} else if fi.IsDir() {
return nil, fmt.Errorf("%s must be a file, not a directory", indexFile)
}

@ -20,8 +20,15 @@ package main
import (
"os"
"path/filepath"
"k8s.io/helm/pkg/helm/helmpath"
)
func createLink(indexFile, cacheFile string) {
os.Symlink(indexFile, cacheFile)
func createLink(indexFile, cacheFile string, home helmpath.Home) error {
fp, err := filepath.Rel(home.Cache(), indexFile)
if err != nil {
return err
}
return os.Symlink(fp, filepath.Join(home.Cache(), 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)
}

Loading…
Cancel
Save