Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
1f6e1555
Commit
1f6e1555
authored
Mar 02, 2020
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up jira function
parent
95220004
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
jira.plugin.zsh
plugins/jira/jira.plugin.zsh
+13
-8
No files found.
plugins/jira/jira.plugin.zsh
View file @
1f6e1555
...
@@ -63,19 +63,24 @@ function jira() {
...
@@ -63,19 +63,24 @@ function jira() {
else
else
# Anything that doesn't match a special action is considered an issue name
# 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
# but `branch` is a special case that will parse the current git branch
local
issue_arg issue
if
[[
"
$action
"
==
"branch"
]]
;
then
if
[[
"
$action
"
==
"branch"
]]
;
then
local
issue_arg
=
$(
git rev-parse
--abbrev-ref
HEAD
)
# Get name of the branch
issue_arg
=(
$(
echo
$issue_arg
|
cut
-d
'_'
-f1
)
)
issue_arg
=
$(
git rev-parse
--abbrev-ref
HEAD
)
if
[[
$(
echo
${
issue_arg
}
|
grep
${
jira_prefix
})
]]
;
then
# Split by _ character and get the first element
local
issue
=
"
${
issue_arg
}
"
issue_arg
=(
${
(s
:_:
)issue_arg
}
)
issue_arg
=
${
issue_arg
[1]
}
if
[[
"
$issue_arg
"
=
${
jira_prefix
}*
]]
;
then
issue
=
"
${
issue_arg
}
"
else
else
local
issue
=
"
${
jira_prefix
}${
issue_arg
}
"
issue
=
"
${
jira_prefix
}${
issue_arg
}
"
fi
fi
else
else
local
issue_arg
=
${
(U)action
}
issue_arg
=
${
(U)action
}
local
issue
=
"
${
jira_prefix
}${
issue_arg
}
"
issue
=
"
${
jira_prefix
}${
issue_arg
}
"
fi
fi
local
url_fragment
=
''
local
url_fragment
if
[[
"
$2
"
==
"m"
]]
;
then
if
[[
"
$2
"
==
"m"
]]
;
then
url_fragment
=
"#add-comment"
url_fragment
=
"#add-comment"
echo
"Add comment to issue #
$issue
"
echo
"Add comment to issue #
$issue
"
...
...
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