Skip to content

Commit

Permalink
fix bogus exit
Browse files Browse the repository at this point in the history
  • Loading branch information
esilva-everbridge committed May 24, 2018
1 parent 41a130c commit ffa677e
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ var appCommands = []cli.Command{
Action: func(c *cli.Context) error {
err := processDir(recurseDir, ".sls", "encrypt")
if err != nil {
logger.Fatalf("encrypt: %s", err)
logger.Warnf("encrypt: %s", err)
}
return nil
},
Expand Down Expand Up @@ -295,7 +295,7 @@ var appCommands = []cli.Command{
Action: func(c *cli.Context) error {
err := processDir(recurseDir, ".sls", "decrypt")
if err != nil {
logger.Fatalf("decrypt: %s", err)
logger.Warnf("decrypt: %s", err)
}
return nil
},
Expand Down Expand Up @@ -341,7 +341,7 @@ var appCommands = []cli.Command{
} else {
err := processDir(recurseDir, ".sls", "rotate")
if err != nil {
logger.Fatalf("rotate: %s", err)
logger.Warnf("rotate: %s", err)
}
}
return nil
Expand Down Expand Up @@ -381,7 +381,7 @@ var appCommands = []cli.Command{
Action: func(c *cli.Context) error {
err := processDir(recurseDir, ".sls", "validate")
if err != nil {
logger.Fatalf("keys: %s", err)
logger.Warnf("keys: %s", err)
}
return nil
},
Expand Down Expand Up @@ -509,14 +509,11 @@ func applyActionAndWrite(file string, action string, pk *pki.Pki, errChan chan e
}

buf, err := s.PerformAction(action)
if err != nil && action != sls.Validate {
handleErr(err, errChan)
if buf.Len() > 0 && err != nil && action != sls.Validate {
logger.Warnf("%s", err)
}

if action == sls.Validate && buf.Len() > 0 {
if err != nil {
logger.Warnf("%s", err)
}
if action == sls.Validate {
fmt.Printf("%s\n", buf.String())
return 0
}
Expand Down

0 comments on commit ffa677e

Please sign in to comment.