Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
37f45eb6
Commit
37f45eb6
authored
Jul 07, 2015
by
Patryk Małek
Browse files
Making variables local in jira plugin
parent
1e991686
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/jira/jira.plugin.zsh
View file @
37f45eb6
...
@@ -19,6 +19,7 @@ open_jira_issue () {
...
@@ -19,6 +19,7 @@ open_jira_issue () {
open_cmd
=
'xdg-open'
open_cmd
=
'xdg-open'
fi
fi
local
jira_url
if
[
-f
.jira-url
]
;
then
if
[
-f
.jira-url
]
;
then
jira_url
=
$(
cat
.jira-url
)
jira_url
=
$(
cat
.jira-url
)
elif
[
-f
~/.jira-url
]
;
then
elif
[
-f
~/.jira-url
]
;
then
...
@@ -30,6 +31,7 @@ open_jira_issue () {
...
@@ -30,6 +31,7 @@ open_jira_issue () {
return
1
return
1
fi
fi
local
jira_prefix
if
[
-f
.jira-prefix
]
;
then
if
[
-f
.jira-prefix
]
;
then
jira_prefix
=
$(
cat
.jira-prefix
)
jira_prefix
=
$(
cat
.jira-prefix
)
elif
[
-f
~/.jira-prefix
]
;
then
elif
[
-f
~/.jira-prefix
]
;
then
...
@@ -45,7 +47,7 @@ open_jira_issue () {
...
@@ -45,7 +47,7 @@ open_jira_issue () {
$open_cmd
"
${
jira_url
}
/secure/CreateIssue!default.jspa"
$open_cmd
"
${
jira_url
}
/secure/CreateIssue!default.jspa"
elif
[[
"
$1
"
=
"assigned"
||
"
$1
"
=
"reported"
]]
;
then
elif
[[
"
$1
"
=
"assigned"
||
"
$1
"
=
"reported"
]]
;
then
jira_query
$@
jira_query
$@
else
else
local
addcomment
=
''
local
addcomment
=
''
if
[[
"
$2
"
==
"m"
]]
;
then
if
[[
"
$2
"
==
"m"
]]
;
then
addcomment
=
"#add-comment"
addcomment
=
"#add-comment"
...
@@ -53,11 +55,11 @@ open_jira_issue () {
...
@@ -53,11 +55,11 @@ open_jira_issue () {
else
else
echo
"Opening issue #
$1
"
echo
"Opening issue #
$1
"
fi
fi
if
[[
"
$JIRA_RAPID_BOARD
"
==
"true"
]]
;
then
if
[[
"
$JIRA_RAPID_BOARD
"
==
"true"
]]
;
then
$open_cmd
"
$jira_url
/issues/
$jira_prefix$1$addcomment
"
$open_cmd
"
$jira_url
/issues/
$jira_prefix$1$addcomment
"
else
else
$open_cmd
"
$jira_url
/browse/
$jira_prefix$1$addcomment
"
$open_cmd
"
$jira_url
/browse/
$jira_prefix$1$addcomment
"
fi
fi
fi
fi
}
}
...
@@ -76,7 +78,11 @@ jira_name () {
...
@@ -76,7 +78,11 @@ jira_name () {
}
}
jira_query
()
{
jira_query
()
{
local
jira_name
local
verb
verb
=
"
$1
"
verb
=
"
$1
"
local
lookup
local
preposition
if
[[
"
${
verb
}
"
=
"reported"
]]
;
then
if
[[
"
${
verb
}
"
=
"reported"
]]
;
then
lookup
=
reporter
lookup
=
reporter
preposition
=
by
preposition
=
by
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment