diff options
Diffstat (limited to 'youtrack-workflow-editor.sh')
-rw-r--r-- | youtrack-workflow-editor.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/youtrack-workflow-editor.sh b/youtrack-workflow-editor.sh index d2c67165c232..13474bb6a5e2 100644 --- a/youtrack-workflow-editor.sh +++ b/youtrack-workflow-editor.sh @@ -1,2 +1,15 @@ #!/bin/sh + +# Find first instance of Java 6 +JAVA_ENV_NAME=$(archlinux-java status | grep -o -m 1 'java-6.*$') +if [ -z "$JAVA_ENV_NAME" ]; then + # Try Java 5 instead + JAVA_ENV_NAME=$(archlinux-java status | grep -o -m 1 'java-5.*$') +fi + +# If we have a JAVA_ENV_NAME then we will use it, otherwise let YouTrack show error. +if [ -n "$JAVA_ENV_NAME" ]; then + export PATH=/usr/lib/jvm/$JAVA_ENV_NAME/jre/bin/:$PATH +fi + exec /usr/share/youtrack-workflow-editor/youtrack-workflow.sh $* |