X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/3adcfba70e98d8248f36c69c9c54fa6c11c8683a..7b33d20196938812433b59a8b8d6ebaf4758df40:/version.sh?ds=inline diff --git a/version.sh b/version.sh index 2508390b..3d2ce58d 100755 --- a/version.sh +++ b/version.sh @@ -1,5 +1,15 @@ #!/bin/bash -ver=$(git describe --tags --dirty="+") -ver=${ver#v} -ver=${ver//-/.} -echo "${ver}" + +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}"