tj.git-extras/bin/git-extras
2012-06-04 13:51:13 -07:00

31 lines
563 B
Bash
Executable file

#!/bin/sh
VERSION="1.6.0"
update() {
local bin=$(which git-extras)
local prefix=${bin%/*/*}
local orig=$PWD
cd /tmp \
&& rm -fr ./git-extras \
&& git clone --depth 1 https://github.com/visionmedia/git-extras.git \
&& cd git-extras \
&& PREFIX="$prefix" 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