From 3fdd466d7cc902a41ac22190483f99acb2fa8ec3 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 21 Mar 2017 16:29:15 +0800 Subject: [PATCH] refactor get default build logs. Signed-off-by: Bo-Yi Wu --- drone/build_logs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drone/build_logs.go b/drone/build_logs.go index 0ed821b6..2c14243e 100644 --- a/drone/build_logs.go +++ b/drone/build_logs.go @@ -34,7 +34,7 @@ func buildLogs(c *cli.Context) error { buildArg := c.Args().Get(1) var number int - if buildArg == "last" { + if buildArg == "" { // Fetch the build number from the last build build, err := client.BuildLast(owner, name, "") if err != nil { @@ -44,7 +44,7 @@ func buildLogs(c *cli.Context) error { } else { number, err = strconv.Atoi(buildArg) if err != nil { - return err + return fmt.Errorf("Error: Invalid number or missing job number. eg 100") } } @@ -72,7 +72,7 @@ func buildLogs(c *cli.Context) error { if err = dec.Decode(&line); err != nil { return err } - fmt.Printf("%s\n", line.Out) + fmt.Printf("%s", line.Out) } _, err = dec.Token()