From 929bc8a8a3613a5dde9bdaaad03d37c043a4ee4b Mon Sep 17 00:00:00 2001 From: axtloss Date: Sat, 9 Nov 2024 13:44:08 +0100 Subject: [PATCH] fix: exit with non zero returncode on error --- cmd/root.go | 1 + main.go | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 33e6e54..f19208c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -20,6 +20,7 @@ var rootCmd = &cobra.Command{ Use: "vib", Short: "Vib is a tool to build container images from recipes using modules", Long: "Vib is a tool to build container images from YAML recipes using modules to define the steps to build the image.", + SilenceUsage: true, Version: Version, } diff --git a/main.go b/main.go index 82499ea..ce41384 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "os" "github.com/vanilla-os/vib/cmd" ) @@ -9,5 +10,8 @@ var ( ) func main() { - cmd.Execute() + err := cmd.Execute() + if (err != nil) { + os.Exit(1) + } }