Provide X-compatible find_binary function that finds a binary for a given command. Works with zsh/bash
This commit is contained in:
@@ -12,11 +12,15 @@ disable_nullglob() { if [ $shell = "zsh" ]; then unsetopt NULL_GLOB; else shopt
|
||||
# Alias wrapper that ignores errors if alias is not defined.
|
||||
_alias(){ alias "$@" 2> /dev/null; }
|
||||
|
||||
if [ $shell = "zsh" ]; then
|
||||
export GIT_BINARY=$(type -p git | sed 's/git is //' | head -1)
|
||||
else
|
||||
export GIT_BINARY=$(type -P git)
|
||||
fi
|
||||
find_binary(){
|
||||
if [ $shell = "zsh" ]; then
|
||||
type -p "$1" | sed "s/$1 is //" | head -1
|
||||
else
|
||||
type -P "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
export GIT_BINARY=$(find_binary git)
|
||||
|
||||
# Updates SCM Breeze from GitHub.
|
||||
update_scm_breeze() {
|
||||
|
||||
Reference in New Issue
Block a user