summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-12-06 03:04:40 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2010-12-06 03:05:08 -0800
commit75896941dcc686055fe7ac8e6a86d54a69aac216 (patch)
tree283f5d45bc533be3df890796c6178a0aeec22b42
parent470713ccba97fc9cd0620f11b3a2fd740792410f (diff)
Allow ./version.sh on a specified commit-ish.
-rwxr-xr-xversion.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/version.sh b/version.sh
index 1e204f3..7fcf151 100755
--- a/version.sh
+++ b/version.sh
@@ -1,4 +1,11 @@
#!/bin/bash
-echo -n "$(git describe --tags --dirty="+" --match="v*" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@')"
+
+if [[ $# -eq 0 ]]; then
+ flags=(--dirty="+")
+else
+ flags=("$@")
+fi
+
+echo -n "$(git describe --tags --match="v*" "${flags[@]}" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@')"
grep '#define ForRelease 0' MobileCydia.mm &>/dev/null && echo -n '~srk'
echo