summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-27 16:06:11 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-27 16:06:11 -0400
commit06a771993a6fe49d7e3253a09c7e9eadcde1add9 (patch)
tree8ae8c807fa6b61b529e7d27c7ee35ec063d021b9
parent724ddbe789e3587739b4bd9ac5ac5315822c86a2 (diff)
add git-shell wrappers
-rw-r--r--debian/changelog6
-rwxr-xr-xstandalone/linux/skel/git-shell31
-rwxr-xr-xstandalone/osx/git-annex.app/Contents/MacOS/git-shell31
3 files changed, 65 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index e1200044e..11e1d21ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,9 +4,9 @@ git-annex (5.20131222) UNRELEASED; urgency=medium
(tasty was stuck in incoming.)
* Fix typo in test suite.
* Fix bug in Linux standalone build's shimming that broke git-annex-shell.
- * Include git-receive-pack, git-upload-pack, and git wrappers in the Linux
- standalone build, and OSX app, so they will be available when it's
- added to PATH.
+ * Include git-receive-pack, git-upload-pack, git, and git-shell wrappers
+ in the Linux standalone build, and OSX app, so they will be available
+ when it's added to PATH.
* Added new external special remote interface.
-- Joey Hess <joeyh@debian.org> Tue, 24 Dec 2013 13:54:32 -0400
diff --git a/standalone/linux/skel/git-shell b/standalone/linux/skel/git-shell
new file mode 100755
index 000000000..4dbc4d1ca
--- /dev/null
+++ b/standalone/linux/skel/git-shell
@@ -0,0 +1,31 @@
+#!/bin/sh
+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
+fi
+if [ ! -e "$base/runshell" ]; then
+ echo "** cannot find $base/runshell" >&2
+ exit 1
+fi
+
+# Get absolute path to base, to avoid breakage when things change directories.
+orig="$(pwd)"
+cd "$base"
+base="$(pwd)"
+cd "$orig"
+
+# If this is a standalone app, set a variable that git-annex can use to
+# install itself.
+if [ -e "$base/bin/git-annex" ]; then
+ GIT_ANNEX_APP_BASE="$base"
+ export GIT_ANNEX_APP_BASE
+fi
+
+exec "$base/runshell" git shell "$@"
diff --git a/standalone/osx/git-annex.app/Contents/MacOS/git-shell b/standalone/osx/git-annex.app/Contents/MacOS/git-shell
new file mode 100755
index 000000000..5088d3466
--- /dev/null
+++ b/standalone/osx/git-annex.app/Contents/MacOS/git-shell
@@ -0,0 +1,31 @@
+#!/bin/sh
+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
+fi
+if [ ! -e "$base/runshell" ]; then
+ echo "** cannot find $base/runshell" >&2
+ exit 1
+fi
+
+# Get absolute path to base, to avoid breakage when things change directories.
+orig="$(pwd)"
+cd "$base"
+base="$(pwd)"
+cd "$orig"
+
+# If this is a standalone app, set a variable that git-annex can use to
+# install itself.
+if [ -e "$base/git-annex" ]; then
+ GIT_ANNEX_APP_BASE="$base"
+ export GIT_ANNEX_APP_BASE
+fi
+
+exec "$base/runshell" git shell "$@"