Commit f483264e authored by Matt Butcher's avatar Matt Butcher

fix(helm): fix output of helm package command

parent 5ddae22a
...@@ -54,21 +54,25 @@ func runPackage(cmd *cobra.Command, args []string) error { ...@@ -54,21 +54,25 @@ func runPackage(cmd *cobra.Command, args []string) error {
return err return err
} }
// Save to $HELM_HOME/local directory.
if save {
if err := repo.AddChartToLocalRepo(ch, localRepoDirectory()); err != nil {
return err
}
}
// Save to the current working directory. // Save to the current working directory.
cwd, err := os.Getwd() cwd, err := os.Getwd()
if err != nil { if err != nil {
return err return err
} }
name, err := chart.Save(ch, cwd) name, err := chart.Save(ch, cwd)
if err == nil { if err == nil && flagVerbose {
cmd.Printf("Saved %s to current directory\n", name) cmd.Printf("Saved %s to current directory\n", name)
} }
// Save to $HELM_HOME/local directory. This is second, because we don't want
// the case where we saved here, but didn't save to the default destination.
if save {
if err := repo.AddChartToLocalRepo(ch, localRepoDirectory()); err != nil {
return err
} else if flagVerbose {
cmd.Printf("Saved %s to %s\n", name, localRepoDirectory())
}
}
return err return err
} }
...@@ -43,7 +43,7 @@ func serveFile(w http.ResponseWriter, r *http.Request, file string) { ...@@ -43,7 +43,7 @@ func serveFile(w http.ResponseWriter, r *http.Request, file string) {
// AddChartToLocalRepo saves a chart in the given path and then reindexes the index file // AddChartToLocalRepo saves a chart in the given path and then reindexes the index file
func AddChartToLocalRepo(ch *chart.Chart, path string) error { func AddChartToLocalRepo(ch *chart.Chart, path string) error {
name, err := chart.Save(ch, path) _, err := chart.Save(ch, path)
if err != nil { if err != nil {
return err return err
} }
...@@ -51,7 +51,6 @@ func AddChartToLocalRepo(ch *chart.Chart, path string) error { ...@@ -51,7 +51,6 @@ func AddChartToLocalRepo(ch *chart.Chart, path string) error {
if err != nil { if err != nil {
return err return err
} }
fmt.Printf("Saved %s to $HELM_HOME/local", name)
return nil 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