summaryrefslogtreecommitdiff
path: root/standalone/linux
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-15 15:57:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-15 15:57:41 -0400
commit84f7dab35401c896e426b49ca5e95b5a9b4952ab (patch)
tree8ad0ca96b65964df0ee6a7ef81ed0d312b213089 /standalone/linux
parent1dc1d698041dd588f063370d056b79b1a4fffb8d (diff)
Programs from Linux and OSX standalone builds can now be symlinked into a directory in PATH as an alternative installation method, and will use readlink to find where the build was unpacked.
Diffstat (limited to 'standalone/linux')
-rwxr-xr-xstandalone/linux/git-annex8
-rwxr-xr-xstandalone/linux/git-annex-shell8
-rwxr-xr-xstandalone/linux/git-annex-webapp8
3 files changed, 21 insertions, 3 deletions
diff --git a/standalone/linux/git-annex b/standalone/linux/git-annex
index d9ec8baa5..27df466e4 100755
--- a/standalone/linux/git-annex
+++ b/standalone/linux/git-annex
@@ -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
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
diff --git a/standalone/linux/git-annex-webapp b/standalone/linux/git-annex-webapp
index 2698af9b5..acf2a5135 100755
--- a/standalone/linux/git-annex-webapp
+++ b/standalone/linux/git-annex-webapp
@@ -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