git-annex/standalone/osx/git-annex.app/Contents/MacOS/runshell
Joey Hess e213ef310f git-annex (5.20140717) unstable; urgency=high
* Fix minor FD leak in journal code. Closes: #754608
  * direct: Fix handling of case where a work tree subdirectory cannot
    be written to due to permissions.
  * migrate: Avoid re-checksumming when migrating from hashE to hash backend.
  * uninit: Avoid failing final removal in some direct mode repositories
    due to file modes.
  * S3: Deal with AWS ACL configurations that do not allow creating or
    checking the location of a bucket, but only reading and writing content to
    it.
  * resolvemerge: New plumbing command that runs the automatic merge conflict
    resolver.
  * Deal with change in git 2.0 that made indirect mode merge conflict
    resolution leave behind old files.
  * sync: Fix git sync with local git remotes even when they don't have an
    annex.uuid set. (The assistant already did so.)
  * Set gcrypt-publish-participants when setting up a gcrypt repository,
    to avoid unncessary passphrase prompts.
    This is a security/usability tradeoff. To avoid exposing the gpg key
    ids who can decrypt the repository, users can unset
    gcrypt-publish-participants.
  * Install nautilus hooks even when ~/.local/share/nautilus/ does not yet
    exist, since it is not automatically created for Gnome 3 users.
  * Windows: Move .vbs files out of git\bin, to avoid that being in the
    PATH, which caused some weird breakage. (Thanks, divB)
  * Windows: Fix locking issue that prevented the webapp starting
    (since 5.20140707).

# imported from the archive
2014-07-17 11:27:25 -04:00

86 lines
2.1 KiB
Bash
Executable file

#!/bin/sh
# Runs a shell command (or interactive shell) using the binaries
# bundled with this app.
set -e
base="$(dirname "$0")"
if [ ! -d "$base" ]; then
echo "** cannot find base directory (I seem to be $0)" >&2
exit 1
fi
bundle="$base/bundle"
if [ ! -e "$bundle/git-annex" ]; then
echo "** bundle directory $bundle does not contain git-annex" >&2
exit 1
fi
if [ ! -e "$bundle/git" ]; then
echo "** bundle directory $bundle does not contain git" >&2
exit 1
fi
# Get absolute path to base, to avoid breakage when things change directories.
orig="$(pwd)"
cd "$base"
base="$(pwd)"
cd "$orig"
# Install shim that's used to run git-annex-shell from ssh authorized_keys.
# The assistant also does this when run, but the user may not be using the
# assistant.
if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
(
echo "#!/bin/sh"
echo "set -e"
echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
echo "else"
echo "exec $base/runshell git-annex-shell -c \"\$@\""
echo "fi"
) > "$HOME/.ssh/git-annex-shell"
chmod +x "$HOME/.ssh/git-annex-shell"
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"
fi
# Put our binaries first, to avoid issues with out of date or incompatable
# system binaries.
ORIG_PATH="$PATH"
export ORIG_PATH
PATH=$bundle:$PATH
export PATH
ORIG_GIT_EXEC_PATH="$GIT_EXEC_PATH"
export ORIG_GIT_EXEC_PATH
GIT_EXEC_PATH=$bundle
export GIT_EXEC_PATH
ORIG_GIT_TEMPLATE_DIR="$GIT_TEMPLATE_DIR"
export ORIG_GIT_TEMPLATE_DIR
GIT_TEMPLATE_DIR="$bundle/templates"
export GIT_TEMPLATE_DIR
# Indicate which variables were exported above.
GIT_ANNEX_STANDLONE_ENV="PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR"
export GIT_ANNEX_STANDLONE_ENV
if [ "$1" ]; then
cmd="$1"
shift 1
exec "$cmd" "$@"
else
$SHELL
fi