Commit c7e57191 authored by Michelle Noorali's avatar Michelle Noorali

feat(helm): download cache file when adding repo

parent 45933826
package main
import (
"errors"
"fmt"
"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 {
return err
}
name, url := args[0], args[1]
err := insertRepoLine(args[0], args[1])
if err != nil {
if err := downloadCacheFile(name, url); 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
}
fmt.Println(args[0] + " has been added to your repositories")
return nil
}
......
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