|
Revision 50285fb5306ccf0ddf4e8db87363c96703f0821c, 0.5 kB
(checked in by RedBrain - Philip Herron <herron.philip@…>, 3 years ago)
|
On branch master
modified: config/git.sh
modified: configure.ac
modified: src/Makefile.am
modified: src/main.c
modified: src/util.c
|
-
Property mode set to
100644
|
| Line | |
|---|
| 1 | #!/usr/bin/env bash |
|---|
| 2 | |
|---|
| 3 | #handy to keep by :) |
|---|
| 4 | die() { echo "$@"; exit 1; } |
|---|
| 5 | |
|---|
| 6 | run() { |
|---|
| 7 | echo "$ARGV0: running \`$@' $ARGS" 2>&1 |
|---|
| 8 | $@ $ARGS |
|---|
| 9 | } |
|---|
| 10 | |
|---|
| 11 | ARGV0=$0 |
|---|
| 12 | ARGS="$@" |
|---|
| 13 | |
|---|
| 14 | set -e |
|---|
| 15 | |
|---|
| 16 | if test x$GIT = x; then |
|---|
| 17 | if test \! "x`which git 2> /dev/null | grep -v '^no'`" = x; then |
|---|
| 18 | GIT=git |
|---|
| 19 | else |
|---|
| 20 | #echo "git wasn't found, exiting"; exit 1 |
|---|
| 21 | exit 1 |
|---|
| 22 | fi |
|---|
| 23 | fi |
|---|
| 24 | |
|---|
| 25 | if [ -d ".git" ]; then |
|---|
| 26 | if test x$1 = "xcommit"; then |
|---|
| 27 | run $GIT || die "Problem executing git" |
|---|
| 28 | elif test x$1 = "xbranch"; then |
|---|
| 29 | _BRANCH=`$GIT branch` |
|---|
| 30 | fi |
|---|
| 31 | else |
|---|
| 32 | echo "not a git repo!" 2>&1 |
|---|
| 33 | exit 1; |
|---|
| 34 | fi |
|---|