diff options
author | Joey Hess <joey@kitenet.net> | 2013-12-27 16:06:11 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-12-27 16:06:11 -0400 |
commit | 06a771993a6fe49d7e3253a09c7e9eadcde1add9 (patch) | |
tree | 8ae8c807fa6b61b529e7d27c7ee35ec063d021b9 /standalone | |
parent | 724ddbe789e3587739b4bd9ac5ac5315822c86a2 (diff) |
add git-shell wrappers
Diffstat (limited to 'standalone')
-rwxr-xr-x | standalone/linux/skel/git-shell | 31 | ||||
-rwxr-xr-x | standalone/osx/git-annex.app/Contents/MacOS/git-shell | 31 |
2 files changed, 62 insertions, 0 deletions
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 "$@" |