X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/1869a99c20d97931010559d20aedaef0e3225b24..7b33d20196938812433b59a8b8d6ebaf4758df40:/version.sh diff --git a/version.sh b/version.sh index 1cbbfbf8..3d2ce58d 100755 --- a/version.sh +++ b/version.sh @@ -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}"