packer: Handle errors with executing the CLI

This commit is contained in:
Mitchell Hashimoto 2013-05-08 14:53:20 -07:00
parent c5e83a4b15
commit 6633f3df80
1 changed files with 6 additions and 1 deletions

View File

@ -50,7 +50,12 @@ func main() {
os.Exit(1)
}
exitCode, _ := env.Cli(os.Args[1:])
exitCode, err := env.Cli(os.Args[1:])
if err != nil {
fmt.Fprintf(os.Stderr, "Error executing CLI: %s\n", err.Error())
os.Exit(1)
}
plugin.CleanupClients()
os.Exit(exitCode)
}