|
|
@ -6,6 +6,7 @@ import (
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
"net/url"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"path/filepath"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
@ -34,13 +35,18 @@ func fetch(cmd *cobra.Command, args []string) error {
|
|
|
|
return fmt.Errorf("This command needs at least one argument, url or repo/name of the chart.")
|
|
|
|
return fmt.Errorf("This command needs at least one argument, url or repo/name of the chart.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pname := args[0]
|
|
|
|
|
|
|
|
if filepath.Ext(pname) != ".tgz" {
|
|
|
|
|
|
|
|
pname += ".tgz"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
f, err := repo.LoadRepositoriesFile(repositoriesFile())
|
|
|
|
f, err := repo.LoadRepositoriesFile(repositoriesFile())
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// get download url
|
|
|
|
// get download url
|
|
|
|
u, err := mapRepoArg(args[0], f.Repositories)
|
|
|
|
u, err := mapRepoArg(pname, f.Repositories)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|