From 78b6d6ca7b53671ab74776ebf30d88df58e9b712 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Thu, 28 May 2015 11:30:35 +0300 Subject: [PATCH] Send error messages to stderr. #249 --- cmd/run.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/run.go b/cmd/run.go index 1e782225..ec78ae5b 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -4,6 +4,7 @@ import ( "fmt" ctx "github.com/smira/aptly/context" "github.com/smira/commander" + "os" ) // Run runs single command starting from root cmd with args, optionally initializing context @@ -14,7 +15,7 @@ func Run(cmd *commander.Command, cmdArgs []string, initContext bool) (returnCode if !ok { panic(r) } - fmt.Println("ERROR:", fatal.Message) + fmt.Fprintln(os.Stderr, "ERROR:", fatal.Message) returnCode = fatal.ReturnCode } }()