diff --git a/check-my-stuff b/check-my-stuff index 2c8eda7ff..b75adc593 100755 --- a/check-my-stuff +++ b/check-my-stuff @@ -6,7 +6,7 @@ if [ "$#" -eq "0" ] exit fi -BASE="$(realpath "$0")" +BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")" BASE="$(dirname "$BASE")" cd "$BASE" || exit 1 diff --git a/check-pol b/check-pol index bc8abaf3e..4b5cc826c 100755 --- a/check-pol +++ b/check-pol @@ -7,7 +7,7 @@ if [ $# -eq 0 ] exit fi -BASE="$(realpath "$0")" +BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")" BASE="$(dirname "$BASE")" cd "$BASE" || exit 1 diff --git a/fmt-my-stuff b/fmt-my-stuff index 615f66ccd..8fc08d33b 100755 --- a/fmt-my-stuff +++ b/fmt-my-stuff @@ -6,7 +6,7 @@ if [ "$#" -eq "0" ] exit fi -BASE="$(realpath "$0")" +BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")" BASE="$(dirname "$BASE")" grep -lr $1 $BASE/data/ | while read line; do utils/schema-check/dn42-schema.py fmt -i $line; done diff --git a/install-commit-hook b/install-commit-hook index 63a3d965c..a28a7b3f1 100755 --- a/install-commit-hook +++ b/install-commit-hook @@ -6,7 +6,7 @@ if [ $# -eq 0 ] exit fi -BASE="$(realpath "$0")" +BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")" BASE="$(dirname "$BASE")" cd "$BASE" || exit 1