aboutsummaryrefslogtreecommitdiff
path: root/standalone
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-10 11:42:06 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-10 11:42:06 -0400
commit96f6a72577595faad00f31b214ae25e3bec4b5b3 (patch)
treeb84e38bbf04546f47d8b8441026f1ce0ee5eefbd /standalone
parentca6bfa0691228480cc8de4bd697bc3c23a576f65 (diff)
runshell: Avoid failing when $HOME/.ssh does not exist and cannot be created.
Diffstat (limited to 'standalone')
-rwxr-xr-xstandalone/linux/skel/runshell14
-rwxr-xr-xstandalone/osx/git-annex.app/Contents/MacOS/runshell14
2 files changed, 16 insertions, 12 deletions
diff --git a/standalone/linux/skel/runshell b/standalone/linux/skel/runshell
index b540c983b..68a462266 100755
--- a/standalone/linux/skel/runshell
+++ b/standalone/linux/skel/runshell
@@ -64,12 +64,14 @@ fi
# And this shim is used by the webapp when adding a remote ssh server.
if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
- (
- echo "#!/bin/sh"
- echo "set -e"
- echo "exec '$base/runshell' \"\$@\""
- ) > "$HOME/.ssh/git-annex-wrapper"
- chmod +x "$HOME/.ssh/git-annex-wrapper"
+ if [ -e "$HOME/.ssh" ]; then
+ (
+ echo "#!/bin/sh"
+ echo "set -e"
+ echo "exec '$base/runshell' \"\$@\""
+ ) > "$HOME/.ssh/git-annex-wrapper"
+ chmod +x "$HOME/.ssh/git-annex-wrapper"
+ fi
fi
# Put our binaries first, to avoid issues with out of date or incompatable
diff --git a/standalone/osx/git-annex.app/Contents/MacOS/runshell b/standalone/osx/git-annex.app/Contents/MacOS/runshell
index 0af0a0c6f..b48017f43 100755
--- a/standalone/osx/git-annex.app/Contents/MacOS/runshell
+++ b/standalone/osx/git-annex.app/Contents/MacOS/runshell
@@ -50,12 +50,14 @@ fi
# And this shim is used by the webapp when adding a remote ssh server.
if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
- (
- echo "#!/bin/sh"
- echo "set -e"
- echo "exec '$base/runshell' \"\$@\""
- ) > "$HOME/.ssh/git-annex-wrapper"
- chmod +x "$HOME/.ssh/git-annex-wrapper"
+ if [ -e "$HOME/.ssh" ]; then
+ (
+ echo "#!/bin/sh"
+ echo "set -e"
+ echo "exec '$base/runshell' \"\$@\""
+ ) > "$HOME/.ssh/git-annex-wrapper"
+ chmod +x "$HOME/.ssh/git-annex-wrapper"
+ fi
fi
# Put our binaries first, to avoid issues with out of date or incompatable