Allow jira default action file based setting (#6367)

This commit is contained in:
Jarryd Tilbrook 2017-11-01 21:09:10 +08:00 committed by Robby Russell
parent 1e027509d8
commit 6d5b1f1e3b

View File

@ -2,13 +2,19 @@
#
# See README.md for details
: ${JIRA_DEFAULT_ACTION:=new}
function jira() {
emulate -L zsh
local action=${1:=$JIRA_DEFAULT_ACTION}
local action jira_url jira_prefix
if [[ -f .jira-default-action ]]; then
action=$(cat .jira-default-action)
elif [[ -f ~/.jira-default-action ]]; then
action=$(cat ~/.jira-default-action)
elif [[ -n "${JIRA_DEFAULT_ACTION}" ]]; then
action=${JIRA_DEFAULT_ACTION}
else
action="new"
fi
local jira_url jira_prefix
if [[ -f .jira-url ]]; then
jira_url=$(cat .jira-url)
elif [[ -f ~/.jira-url ]]; then