Last active
December 19, 2015 14:39
-
-
Save erbmicha/5970803 to your computer and use it in GitHub Desktop.
patch for env.sh script to allow symlinking (Riak v1.4.0) - FOR HOMEBREW USE ONLY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/env.sh b/lib/env.sh | |
index 17d6ee0..35cfe12 100755 | |
--- a/lib/env.sh | |
+++ b/lib/env.sh | |
@@ -15,10 +15,16 @@ if [ `uname -s` = 'SunOS' -a "${POSIX_SHELL}" != "true" ]; then | |
fi | |
unset POSIX_SHELL # clear it so if we invoke other scripts, they run as ksh as well | |
-RUNNER_SCRIPT_DIR=$(cd ${0%/*} && pwd) | |
+if [ -L $0 ]; then | |
+ RUNNER_SCRIPT_DIR=$(cd ${0%/*} && pwd)/$(dirname $(readlink $0)) | |
+ RUNNER_BASE_DIR=$(cd ${0%/*} && pwd)/$(dirname $(readlink $0))/.. | |
+elif [ -f $0 ]; then | |
+ RUNNER_SCRIPT_DIR=$(cd ${0%/*} && pwd) | |
+ RUNNER_BASE_DIR=$(cd ${0%/*} && pwd)/.. | |
+fi | |
+ | |
RUNNER_SCRIPT=${0##*/} | |
-RUNNER_BASE_DIR=$(cd ${0%/*} && pwd)/.. | |
RUNNER_ETC_DIR=$RUNNER_BASE_DIR/etc | |
RUNNER_LOG_DIR=$RUNNER_BASE_DIR/log | |
RUNNER_LIB_DIR=$RUNNER_BASE_DIR/lib |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment