]> git.saurik.com Git - cydia.git/blobdiff - version.sh
Separate out CyteKit/NSString-Cyte.mm.
[cydia.git] / version.sh
index 1cbbfbf8d6f82f8259e5e758f89d3874d31ef38b..3d2ce58d3cd1b6b3c2c0ec21e7fe2f94ad0b8339 100755 (executable)
@@ -1,2 +1,15 @@
 #!/bin/bash
-git describe --tags --dirty="+" --match="v*" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@'
+
+if [[ $# -eq 0 ]]; then
+    flags=(--dirty="+")
+else
+    flags=("$@")
+fi
+
+version=$(git describe --tags --match="v*" "${flags[@]}" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@')
+
+if grep '#define ForRelease 0' MobileCydia.mm &>/dev/null; then
+    version=${version}~srk
+fi
+
+echo "${version}"