Skip to content

Commit

Permalink
Merge pull request #7 from cou929/bugfix
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
cou929 committed Sep 23, 2015
2 parents 10b685d + 00d83e7 commit 6e7e0b0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions command/clearEstimate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ func CmdClearEstimate(c *cli.Context) {
issueNumer, err := strconv.Atoi(c.Args().Get(0))
if err != nil {
cli.ShowCommandHelp(c, "clearEstimate")
os.Exit(1)
}
client := NewZenhubClient(c)

Expand Down
2 changes: 2 additions & 0 deletions command/estimate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ func CmdEstimate(c *cli.Context) {
issueNumer, err := strconv.Atoi(c.Args().Get(0))
if err != nil {
cli.ShowCommandHelp(c, "estimate")
os.Exit(1)
}
estimateValue, err := strconv.Atoi(c.Args().Get(1))
if err != nil {
cli.ShowCommandHelp(c, "estimate")
os.Exit(1)
}
client := NewZenhubClient(c)

Expand Down
17 changes: 14 additions & 3 deletions command/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"encoding/json"
"fmt"
"os"
"github.com/codegangsta/cli"
zenhub "github.com/cou929/zenhub-client"
"strconv"
Expand Down Expand Up @@ -30,6 +31,7 @@ func CmdIssue(c *cli.Context) {
issueNumber, err := strconv.Atoi(c.Args().Get(0))
if err != nil {
cli.ShowCommandHelp(c, "issue")
os.Exit(1)
}

client := NewZenhubClient(c)
Expand All @@ -56,12 +58,21 @@ func CmdIssue(c *cli.Context) {

result := map[string]interface{}{
"issueNumber": issueNumber,
"pipelineId": pipeline.Id,
"pipelineName": pipeline.Name,
"estimateValue": estimate.Value,
"pipelineId": nil,
"pipelineName": nil,
"estimateValue": nil,
"pluses": pluses,
}

if pipeline != nil {
result["pipelineId"] = pipeline.Id
result["pipelineName"] = pipeline.Name
}

if estimate != nil {
result["estimateValue"] = estimate.Value
}

marshaled, err := json.Marshal(result)
DieIfError(err)

Expand Down
2 changes: 2 additions & 0 deletions command/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ func CmdTransfer(c *cli.Context) {
issueNumer, err := strconv.Atoi(c.Args().Get(0))
if err != nil {
cli.ShowCommandHelp(c, "transfer")
os.Exit(1)
}
pipelineName := c.Args().Get(1)
if pipelineName == "" {
cli.ShowCommandHelp(c, "transfer")
os.Exit(1)
}
client := NewZenhubClient(c)

Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

const Name string = "zhb"
const Version string = "0.1.2"
const Version string = "0.1.3"
2 changes: 1 addition & 1 deletion wercker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ deploy:
- tcnksm/ghr:
token: $GITHUB_TOKEN
input: dist
version: v0.1.2
version: v0.1.3
replace: true

0 comments on commit 6e7e0b0

Please sign in to comment.