diff options
Diffstat (limited to 'plugins/jira/jira.plugin.zsh')
-rw-r--r-- | plugins/jira/jira.plugin.zsh | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index b91f93c95..739ee7142 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -3,7 +3,7 @@ # .jira-url in the current directory takes precedence # # If you use Rapid Board, set: -#JIRA_RAPID_BOARD="yes" +#JIRA_RAPID_BOARD="true" # in you .zshrc # # Setup: cd to/my/project @@ -11,6 +11,13 @@ # Usage: jira # opens a new issue # jira ABC-123 # Opens an existing issue open_jira_issue () { + local open_cmd + if [[ $(uname -s) == 'Darwin' ]]; then + open_cmd='open' + else + open_cmd='xdg-open' + fi + if [ -f .jira-url ]; then jira_url=$(cat .jira-url) elif [ -f ~/.jira-url ]; then @@ -24,13 +31,13 @@ open_jira_issue () { if [ -z "$1" ]; then echo "Opening new issue" - `open $jira_url/secure/CreateIssue!default.jspa` + $open_cmd "$jira_url/secure/CreateIssue!default.jspa" else echo "Opening issue #$1" - if [[ "x$JIRA_RAPID_BOARD" = "yes" ]]; then - `open $jira_url/issues/$1` + if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then + $open_cmd "$jira_url/issues/$1" else - `open $jira_url/browse/$1` + $open_cmd "$jira_url/browse/$1" fi fi } |