Skip to content

Commit

Permalink
Should work now.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersbakken committed Jul 16, 2015
1 parent bad8dd2 commit 54e22c4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/rtags-release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

SCRIPT_PATH=`dirname $(readlink "$0")`;
SCRIPT_PATH=`eval "cd \"$SCRIPT_PATH\" && pwd"`
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
SCRIPT_PATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$SCRIPT_PATH/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SCRIPT_PATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

branch_name="$(git symbolic-ref HEAD 2>/dev/null)" || branch_name="(unnamed branch)" # detached HEAD
branch_name=${branch_name##refs/heads/}
Expand Down

0 comments on commit 54e22c4

Please sign in to comment.