diff options
Diffstat (limited to 'git-sh-setup.sh')
-rwxr-xr-x | git-sh-setup.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 838233926f..80acb7de72 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -11,6 +11,34 @@ # exporting it. unset CDPATH +git_broken_path_fix () { + case ":$PATH:" in + *:$1:*) : ok ;; + *) + PATH=$( + SANE_TOOL_PATH="$1" + IFS=: path= sep= + set x $PATH + shift + for elem + do + case "$SANE_TOOL_PATH:$elem" in + (?*:/bin | ?*:/usr/bin) + path="$path$sep$SANE_TOOL_PATH" + sep=: + SANE_TOOL_PATH= + esac + path="$path$sep$elem" + sep=: + done + echo "$path" + ) + ;; + esac +} + +# @@BROKEN_PATH_FIX@@ + die() { echo >&2 "$@" exit 1 |