aboutsummaryrefslogtreecommitdiff
path: root/share/genbuild.sh
diff options
context:
space:
mode:
Diffstat (limited to 'share/genbuild.sh')
-rwxr-xr-xshare/genbuild.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/share/genbuild.sh b/share/genbuild.sh
index d959877dc8..da50b0d109 100755
--- a/share/genbuild.sh
+++ b/share/genbuild.sh
@@ -1,5 +1,7 @@
#!/bin/sh
-
+if [ $# -gt 1 ]; then
+ cd "$2"
+fi
if [ $# -gt 0 ]; then
FILE="$1"
shift
@@ -7,11 +9,11 @@ if [ $# -gt 0 ]; then
INFO="$(head -n 1 "$FILE")"
fi
else
- echo "Usage: $0 <filename>"
+ echo "Usage: $0 <filename> <srcroot>"
exit 1
fi
-if [ -e "$(which git)" ]; then
+if [ -e "$(which git)" -a -d ".git" ]; then
# clean 'dirty' status of touched files that haven't been modified
git diff >/dev/null 2>/dev/null