From 75896941dcc686055fe7ac8e6a86d54a69aac216 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 6 Dec 2010 03:04:40 -0800 Subject: Allow ./version.sh on a specified commit-ish. --- version.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3