mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-05 05:03:16 +02:00
Revert "JShell07's local pull request"
This commit is contained in:
parent
43922c02f9
commit
663b3b4691
97 changed files with 709 additions and 2226 deletions
|
|
@ -7,7 +7,6 @@ _1st_arguments=(
|
|||
'dashboard:open the dashboard'
|
||||
'reported:search for issues reported by a user'
|
||||
'assigned:search for issues assigned to a user'
|
||||
'br:open the issue named after the git branch of the current directory'
|
||||
'dumpconfig:display effective jira configuration'
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,21 +2,13 @@
|
|||
#
|
||||
# See README.md for details
|
||||
|
||||
: ${JIRA_DEFAULT_ACTION:=new}
|
||||
|
||||
function jira() {
|
||||
emulate -L zsh
|
||||
local action jira_url jira_prefix
|
||||
if [[ -n "$1" ]]; then
|
||||
action=$1
|
||||
elif [[ -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 action=${1:=$JIRA_DEFAULT_ACTION}
|
||||
|
||||
local jira_url jira_prefix
|
||||
if [[ -f .jira-url ]]; then
|
||||
jira_url=$(cat .jira-url)
|
||||
elif [[ -f ~/.jira-url ]]; then
|
||||
|
|
@ -59,14 +51,8 @@ function jira() {
|
|||
echo "JIRA_DEFAULT_ACTION=$JIRA_DEFAULT_ACTION"
|
||||
else
|
||||
# Anything that doesn't match a special action is considered an issue name
|
||||
# but `branch` is a special case that will parse the current git branch
|
||||
if [[ "$action" == "br" ]]; then
|
||||
local issue_arg=$(git rev-parse --abbrev-ref HEAD)
|
||||
local issue="${jira_prefix}${issue_arg}"
|
||||
else
|
||||
local issue_arg=$action
|
||||
local issue="${jira_prefix}${issue_arg}"
|
||||
fi
|
||||
local issue_arg=$action
|
||||
local issue="${jira_prefix}${issue_arg}"
|
||||
local url_fragment=''
|
||||
if [[ "$2" == "m" ]]; then
|
||||
url_fragment="#add-comment"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue