aboutsummaryrefslogtreecommitdiff
path: root/standalone/linux/git-annex-shell
diff options
context:
space:
mode:
Diffstat (limited to 'standalone/linux/git-annex-shell')
-rwxr-xr-xstandalone/linux/git-annex-shell8
1 files changed, 7 insertions, 1 deletions
diff --git a/standalone/linux/git-annex-shell b/standalone/linux/git-annex-shell
index 44d5f694e..a07895591 100755
--- a/standalone/linux/git-annex-shell
+++ b/standalone/linux/git-annex-shell
@@ -1,5 +1,11 @@
#!/bin/sh
-base="$(dirname "$0")"
+link="$(readlink "$0")" || true
+if [ -n "$link" ]; then
+ base="$(dirname "$link")"
+else
+ base="$(dirname "$0")"
+fi
+
if [ ! -d "$base" ]; then
echo "** cannot find base directory (I seem to be $0)" >&2
exit 1