tj.git-extras/bin/git-extras
2015-05-30 12:31:23 +08:00

31 lines
591 B
Bash
Executable file

#!/usr/bin/env bash
VERSION="3.0.0"
update() {
local bin=$(which git-extras)
local prefix=${bin%/*/*}
local orig=$PWD
cd /tmp \
&& rm -fr ./git-extras \
&& git clone https://github.com/tj/git-extras.git \
&& cd git-extras \
&& git checkout $(git describe --tags $(git rev-list --tags --max-count=1))\
&& 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