bd38c50241647a1d0b0e2ca49fb1d6b9a2b88806

Author
Marc-Antoine Lemieux <marc@marcantoinelemieux.com>
Committer
Marc-Antoine Lemieux <marc@marcantoinelemieux.com>
Date

Message

fix the open command in linux using xdg-open

Diff

 1diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
 2index b91f93c9565620f53094880cef5bc0469ab3250f..bea726a54d9cf98d824005b0adbd0f5498a0b294 100644
 3--- a/plugins/jira/jira.plugin.zsh
 4+++ b/plugins/jira/jira.plugin.zsh
 5@@ -11,6 +11,13 @@
 6 # Usage: jira           # opens a new issue
 7 #        jira ABC-123   # Opens an existing issue
 8 open_jira_issue () {
 9+  local open_cmd
10+  if [[ $(uname -s) == 'Darwin' ]]; then
11+    open_cmd='open'
12+  else
13+    open_cmd='xdg-open'
14+  fi
15+
16   if [ -f .jira-url ]; then
17     jira_url=$(cat .jira-url)
18   elif [ -f ~/.jira-url ]; then
19@@ -28,9 +35,9 @@ open_jira_issue () {
20   else
21     echo "Opening issue #$1"
22     if [[ "x$JIRA_RAPID_BOARD" = "yes" ]]; then
23-      `open $jira_url/issues/$1`
24+      $open_cmd  "$jira_url/issues/$1"
25     else
26-      `open $jira_url/browse/$1`
27+      $open_cmd  "$jira_url/browse/$1"
28     fi
29   fi
30 }