mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 13:33:32 +02:00
fix jira trans TRANS ISSUE (case sensitivity issue), also go fmt
This commit is contained in:
+12
-12
@@ -126,7 +126,7 @@ func (c *Cli) CmdEdit(issue string) error {
|
|||||||
|
|
||||||
if resp.StatusCode == 204 {
|
if resp.StatusCode == 204 {
|
||||||
c.Browse(issueData["key"].(string))
|
c.Browse(issueData["key"].(string))
|
||||||
if ! c.opts["quiet"].(bool) {
|
if !c.opts["quiet"].(bool) {
|
||||||
fmt.Printf("OK %s %s/browse/%s\n", issueData["key"], c.endpoint, issueData["key"])
|
fmt.Printf("OK %s %s/browse/%s\n", issueData["key"], c.endpoint, issueData["key"])
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -267,9 +267,9 @@ func (c *Cli) CmdCreate() error {
|
|||||||
c.Browse(key)
|
c.Browse(key)
|
||||||
c.SaveData(map[string]string{
|
c.SaveData(map[string]string{
|
||||||
"issue": key,
|
"issue": key,
|
||||||
"link": link,
|
"link": link,
|
||||||
})
|
})
|
||||||
if ! c.opts["quiet"].(bool) {
|
if !c.opts["quiet"].(bool) {
|
||||||
fmt.Printf("OK %s %s\n", key, link)
|
fmt.Printf("OK %s %s\n", key, link)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -326,7 +326,7 @@ func (c *Cli) CmdBlocks(blocker string, issue string) error {
|
|||||||
}
|
}
|
||||||
if resp.StatusCode == 201 {
|
if resp.StatusCode == 201 {
|
||||||
c.Browse(issue)
|
c.Browse(issue)
|
||||||
if ! c.opts["quiet"].(bool) {
|
if !c.opts["quiet"].(bool) {
|
||||||
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -369,7 +369,7 @@ func (c *Cli) CmdDups(duplicate string, issue string) error {
|
|||||||
}
|
}
|
||||||
if resp.StatusCode == 201 {
|
if resp.StatusCode == 201 {
|
||||||
c.Browse(issue)
|
c.Browse(issue)
|
||||||
if ! c.opts["quiet"].(bool) {
|
if !c.opts["quiet"].(bool) {
|
||||||
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -403,7 +403,7 @@ func (c *Cli) CmdWatch(issue string) error {
|
|||||||
}
|
}
|
||||||
if resp.StatusCode == 204 {
|
if resp.StatusCode == 204 {
|
||||||
c.Browse(issue)
|
c.Browse(issue)
|
||||||
if ! c.opts["quiet"].(bool) {
|
if !c.opts["quiet"].(bool) {
|
||||||
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -432,7 +432,7 @@ func (c *Cli) CmdTransition(issue string, trans string) error {
|
|||||||
name := transition.(map[string]interface{})["name"].(string)
|
name := transition.(map[string]interface{})["name"].(string)
|
||||||
id := transition.(map[string]interface{})["id"].(string)
|
id := transition.(map[string]interface{})["id"].(string)
|
||||||
found = append(found, name)
|
found = append(found, name)
|
||||||
if strings.Contains(strings.ToLower(name), trans) {
|
if strings.Contains(strings.ToLower(name), strings.ToLower(trans)) {
|
||||||
transName = name
|
transName = name
|
||||||
transId = id
|
transId = id
|
||||||
transMeta = transition.(map[string]interface{})
|
transMeta = transition.(map[string]interface{})
|
||||||
@@ -459,7 +459,7 @@ func (c *Cli) CmdTransition(issue string, trans string) error {
|
|||||||
}
|
}
|
||||||
if resp.StatusCode == 204 {
|
if resp.StatusCode == 204 {
|
||||||
c.Browse(issue)
|
c.Browse(issue)
|
||||||
if ! c.opts["quiet"].(bool) {
|
if !c.opts["quiet"].(bool) {
|
||||||
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -512,7 +512,7 @@ func (c *Cli) CmdComment(issue string) error {
|
|||||||
|
|
||||||
if resp.StatusCode == 201 {
|
if resp.StatusCode == 201 {
|
||||||
c.Browse(issue)
|
c.Browse(issue)
|
||||||
if ! c.opts["quiet"].(bool) {
|
if !c.opts["quiet"].(bool) {
|
||||||
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -566,7 +566,7 @@ func (c *Cli) CmdAssign(issue string, user string) error {
|
|||||||
}
|
}
|
||||||
if resp.StatusCode == 204 {
|
if resp.StatusCode == 204 {
|
||||||
c.Browse(issue)
|
c.Browse(issue)
|
||||||
if ! c.opts["quiet"].(bool) {
|
if !c.opts["quiet"].(bool) {
|
||||||
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -609,13 +609,13 @@ func (c *Cli) CmdExportTemplates() error {
|
|||||||
func (c *Cli) CmdRequest(uri, content string) (err error) {
|
func (c *Cli) CmdRequest(uri, content string) (err error) {
|
||||||
log.Debug("request called")
|
log.Debug("request called")
|
||||||
|
|
||||||
if ! strings.HasPrefix(uri, "http") {
|
if !strings.HasPrefix(uri, "http") {
|
||||||
uri = fmt.Sprintf("%s%s", c.endpoint, uri)
|
uri = fmt.Sprintf("%s%s", c.endpoint, uri)
|
||||||
}
|
}
|
||||||
|
|
||||||
method := strings.ToUpper(c.opts["method"].(string))
|
method := strings.ToUpper(c.opts["method"].(string))
|
||||||
var data interface{}
|
var data interface{}
|
||||||
if method == "GET" {
|
if method == "GET" {
|
||||||
data, err = responseToJson(c.get(uri))
|
data, err = responseToJson(c.get(uri))
|
||||||
} else if method == "POST" {
|
} else if method == "POST" {
|
||||||
data, err = responseToJson(c.post(uri, content))
|
data, err = responseToJson(c.post(uri, content))
|
||||||
|
|||||||
+1
-1
@@ -6,8 +6,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gopkg.in/coryb/yaml.v2"
|
|
||||||
"github.com/mgutz/ansi"
|
"github.com/mgutz/ansi"
|
||||||
|
"gopkg.in/coryb/yaml.v2"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|||||||
+3
-3
@@ -14,8 +14,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
log = logging.MustGetLogger("jira")
|
log = logging.MustGetLogger("jira")
|
||||||
format = "%{color}%{time:2006-01-02T15:04:05.000Z07:00} %{level:-5s} [%{shortfile}]%{color:reset} %{message}"
|
format = "%{color}%{time:2006-01-02T15:04:05.000Z07:00} %{level:-5s} [%{shortfile}]%{color:reset} %{message}"
|
||||||
buildVersion string
|
buildVersion string
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ Command Options:
|
|||||||
case "transition":
|
case "transition":
|
||||||
requireArgs(2)
|
requireArgs(2)
|
||||||
setEditing(true)
|
setEditing(true)
|
||||||
err = c.CmdTransition(args[0], args[1])
|
err = c.CmdTransition(args[1], args[0])
|
||||||
case "close":
|
case "close":
|
||||||
requireArgs(1)
|
requireArgs(1)
|
||||||
setEditing(false)
|
setEditing(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user