Making variables local in jira plugin

This commit is contained in:
Patryk Małek 2015-07-07 20:03:58 +02:00
parent 1e99168627
commit 37f45eb621

View file

@ -19,6 +19,7 @@ open_jira_issue () {
open_cmd='xdg-open'
fi
local jira_url
if [ -f .jira-url ]; then
jira_url=$(cat .jira-url)
elif [ -f ~/.jira-url ]; then
@ -30,6 +31,7 @@ open_jira_issue () {
return 1
fi
local jira_prefix
if [ -f .jira-prefix ]; then
jira_prefix=$(cat .jira-prefix)
elif [ -f ~/.jira-prefix ]; then
@ -55,9 +57,9 @@ open_jira_issue () {
fi
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
$open_cmd "$jira_url/browse/$jira_prefix$1$addcomment"
$open_cmd "$jira_url/browse/$jira_prefix$1$addcomment"
fi
fi
}
@ -76,7 +78,11 @@ jira_name () {
}
jira_query () {
local jira_name
local verb
verb="$1"
local lookup
local preposition
if [[ "${verb}" = "reported" ]]; then
lookup=reporter
preposition=by