diff --git a/main.go b/main.go index 1e5a2fe..65946b8 100755 --- a/main.go +++ b/main.go @@ -23,6 +23,8 @@ import ( "fmt" "os" "os/exec" + "os/signal" + "syscall" "github.com/davidovich/summon/cmd" "github.com/davidovich/summon/pkg/summon" @@ -40,6 +42,14 @@ func Main(args []string, box *packr.Box) int { return 1 } + c := make(chan os.Signal) + signal.Notify(c, os.Interrupt, syscall.SIGTERM) + go func() { + for range c { + os.Exit(0) + } + }() + rootCmd := cmd.CreateRootCmd(s, os.Args) err = rootCmd.Execute()