tj.git-extras/bin/git-extras
Wil Moore III b3cf0c8b3d Favoring the use of bash "Parameter Expansion" instead of "dirname" as
"dirname" has some cross-platform challenges.

- removed the superfluous stderr redirection
- switched out dirname for param expansion
2012-06-04 14:34:46 -06:00

31 lines
575 B
Bash
Executable file

#!/bin/sh
VERSION="1.5.1"
update() {
local binfile=$(which git-extras)
local binpath=${binfile%/*/*}
local orig=$PWD
cd /tmp \
&& rm -fr ./git-extras \
&& git clone --depth 1 https://github.com/visionmedia/git-extras.git \
&& cd git-extras \
&& PREFIX=${binpath:=} make install \
&& cd "$orig" \
&& echo "... updated git-extras $VERSION -> $(git extras --version)"
}
case "$1" in
-v|--version)
echo $VERSION && exit 0
;;
update)
update
;;
*)
test "$INSTALL" = "y" && update && exit
man git-extras
;;
esac