tj.git-extras/bin/git-extras
Wil Moore III 0b71ff6797 Corrected git extras update where ${PREFIX} was not honored for make install
- query for $PREFIX given location of `git-extras` script
- prefix `make install` with ${PREFIX} -- empty is given if $PREFIX not
  set allowing makefile to continue to use it's default in that case.
2012-05-30 22:41:56 -06:00

30 lines
627 B
Bash
Executable file

#!/bin/sh
VERSION="1.5.1"
update() {
local binfile=$(which git-extras 2>/dev/null)
local binpath=$(dirname $(dirname ${binfile} 2>/dev/null) 2>/dev/null)
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