and now windows

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

@ -23,7 +23,6 @@ import (
"fmt" "fmt"
"io" "io"
"os" "os"
"path/filepath"
"github.com/spf13/cobra" "github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors" 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 //TODO: take this out and replace with helm update functionality
fp, err := filepath.Rel(home.Cache(), indexFile) if err := createLink(indexFile, cacheFile, home); err != nil {
if err != nil {
return nil, err return nil, err
} }
createLink(fp, 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)
} }

@ -20,8 +20,15 @@ package main
import ( import (
"os" "os"
"path/filepath"
"k8s.io/helm/pkg/helm/helmpath"
) )
func createLink(indexFile, cacheFile string) { func createLink(indexFile, cacheFile string, home helmpath.Home) error {
os.Symlink(indexFile, cacheFile) 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 ( import (
"os" "os"
"k8s.io/helm/pkg/helm/helmpath"
) )
func createLink(indexFile, cacheFile string) { func createLink(indexFile, cacheFile string, home helmpath.Home) error {
os.Link(indexFile, cacheFile) return os.Link(indexFile, cacheFile)
} }

Loading…
Cancel
Save