mirror of
https://github.com/tj/git-extras.git
synced 2026-09-12 00:16:27 -04:00
"dirname" has some cross-platform challenges. - removed the superfluous stderr redirection - switched out dirname for param expansion
31 lines
575 B
Bash
Executable file
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
|