Merge pull request #34 from michelleN/helm-package

ref(package): add error handling on args
pull/613/head
Michelle Noorali 9 years ago
commit 09a3b7ed1e

@ -1,6 +1,7 @@
package main package main
import ( import (
"fmt"
"os" "os"
"path/filepath" "path/filepath"
@ -24,7 +25,7 @@ func init() {
} }
var packageCmd = &cobra.Command{ var packageCmd = &cobra.Command{
Use: "package", Use: "package [CHART_PATH]",
Short: "Package a chart directory into a chart archive.", Short: "Package a chart directory into a chart archive.",
Long: packageDesc, Long: packageDesc,
RunE: runPackage, RunE: runPackage,
@ -32,8 +33,11 @@ var packageCmd = &cobra.Command{
func runPackage(cmd *cobra.Command, args []string) error { func runPackage(cmd *cobra.Command, args []string) error {
path := "." path := "."
if len(args) > 0 { if len(args) > 0 {
path = args[0] path = args[0]
} else {
return fmt.Errorf("This command needs at least one argument, the path to the chart.")
} }
path, err := filepath.Abs(path) path, err := filepath.Abs(path)

Loading…
Cancel
Save