1
0
Fork 0
mirror of https://github.com/drone/drone-cli.git synced 2024-06-06 05:56:03 +02:00

Merge pull request #58 from drone/default

default build or show last job
This commit is contained in:
Brad Rydzewski 2017-07-28 09:46:27 -04:00 committed by GitHub
commit 1b922c7a0d
2 changed files with 5 additions and 1 deletions

View File

@ -36,7 +36,7 @@ func buildInfo(c *cli.Context) error {
}
var number int
if buildArg == "last" {
if buildArg == "last" || len(buildArg) == 0 {
// Fetch the build number from the last build
build, err := client.BuildLast(owner, name, "")
if err != nil {

View File

@ -1,6 +1,7 @@
package build
import (
"errors"
"fmt"
"strconv"
@ -47,6 +48,9 @@ func buildStart(c *cli.Context) (err error) {
}
number = build.Number
} else {
if len(buildArg) == 0 {
return errors.New("missing job number")
}
number, err = strconv.Atoi(buildArg)
if err != nil {
return err