feat(helm): download cache file when adding repo

pull/658/head
Michelle Noorali 9 years ago
parent 459338264e
commit c7e571918d

@ -1,6 +1,7 @@
package main package main
import ( import (
"errors"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
@ -44,11 +45,16 @@ func runRepoAdd(cmd *cobra.Command, args []string) error {
if err := checkArgsLength(2, len(args), "name for the chart repository", "the url of the chart repository"); err != nil { if err := checkArgsLength(2, len(args), "name for the chart repository", "the url of the chart repository"); err != nil {
return err return err
} }
name, url := args[0], args[1]
err := insertRepoLine(args[0], args[1]) if err := downloadCacheFile(name, url); err != nil {
if err != nil { return errors.New("Oops! Looks like " + url + " is not a valid chart repository or cannot be reached\n")
}
if err := insertRepoLine(name, url); err != nil {
return err return err
} }
fmt.Println(args[0] + " has been added to your repositories") fmt.Println(args[0] + " has been added to your repositories")
return nil return nil
} }

Loading…
Cancel
Save