Skip to content

Commit

Permalink
Exit with code 1 after conversion failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Sep 6, 2016
1 parent 2eba0bb commit d46373d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ func main() {
flag.Parse()
if *version {
fmt.Println(VERSION)
os.Exit(0)
return
}

var err error
if *reverse {
if err := toJSON(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(0)
}
err = toJSON()
} else {
if err := toHCL(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
err = toHCL()
}

if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}

Expand Down

0 comments on commit d46373d

Please sign in to comment.