Skip to content

Commit

Permalink
new release removed few unwanted logging
Browse files Browse the repository at this point in the history
  • Loading branch information
vyshakhp committed Jul 17, 2018
1 parent 88b983d commit 291acc9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions helmez.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ func main() {
Value: "values",
},

cli.StringFlag{
Name: "out, o",
Usage: "write the generate yaml to file `values.yaml`",
Value: "values.yaml",
},

cli.StringFlag{
Name: "helmez",
Usage: "default helmez config file `HELMEZ`",
Expand All @@ -64,13 +70,14 @@ func main() {
func Run(c *cli.Context) error {
base := c.String("base")
dir := c.String("dir")
out := c.String("out")
v := prepareValuesFile(base, dir, defaultHelmezConfig)
d, err := yaml.Marshal(&v)
if err != nil {
log.Fatalf("error: %v", err)
return err
}
fmt.Printf("--- t dump:\n%s\n\n", string(d))
return nil
err = ioutil.WriteFile(out, d, 0644)
return err
}

// HelmezConfig config for helmez
Expand Down Expand Up @@ -104,7 +111,6 @@ func prepareValuesFile(base string, dir string, parent HelmezConfig) interface{}

hConfig := new(HelmezConfig)
if err := mergo.Merge(hConfig, parent); err != nil {
log.Printf("here")
log.Fatal(err)
}

Expand All @@ -113,7 +119,6 @@ func prepareValuesFile(base string, dir string, parent HelmezConfig) interface{}
if err == nil {
yaml.Unmarshal(helmez, helmezOvr)
if err := mergo.Merge(hConfig, helmezOvr, mergo.WithOverride); err != nil {
log.Printf("here 1")
log.Fatal(err)
}
}
Expand All @@ -123,7 +128,6 @@ func prepareValuesFile(base string, dir string, parent HelmezConfig) interface{}
valuesFile := hConfig.ValuesFileName
data, err := ioutil.ReadFile(folder + valuesFile)
if err != nil {
log.Printf("here 2")
log.Fatal(err)
}

Expand Down

0 comments on commit 291acc9

Please sign in to comment.