tj.git-extras/bin/git-extras
spacewander 76e0dfef97 replace visionmedia/git-extras to tj/git-extras
Although Github reserves the 'visionmedia' user space(a visit to there
will be redirected to 'tj'), it's better to
rename the links from visionmedia/git-extras to tj/git-extras
2014-11-06 17:12:01 +08:00

30 lines
510 B
Bash
Executable file

#!/bin/sh
VERSION="2.1.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/tj/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
;;
*)
man git-extras
;;
esac