diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-12-08 17:21:40 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-12-08 17:22:15 +0100 |
commit | b512c43296938a9b6c76c660e488692453563d18 (patch) | |
tree | ed9a580c219596f1da6dcd738f897514da0e37f8 /scripts | |
parent | 5a3d0b0d3aa7b9e5e67457b39a765d87c53439cc (diff) | |
download | qtlocation-mapboxgl-b512c43296938a9b6c76c660e488692453563d18.tar.gz |
support fewer parameters
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build-version.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/build-version.py b/scripts/build-version.py index 8db647c888..8261aea536 100644 --- a/scripts/build-version.py +++ b/scripts/build-version.py @@ -5,13 +5,16 @@ import sys, os, errno output_dir = sys.argv[1] -# When they're identical, the git describe can't find a tag and reports the rev instead. -if sys.argv[2] == sys.argv[3]: +if len(sys.argv) <= 3: tag = [0, 0, 0] + rev = sys.argv[2][0:8] else: - tag = map(int, sys.argv[2].split('.')) - -rev = sys.argv[3][0:8] + # When they're identical, the git describe can't find a tag and reports the rev instead. + if sys.argv[2] == sys.argv[3]: + tag = [0, 0, 0] + else: + tag = map(int, sys.argv[2].split('.')) + rev = sys.argv[3][0:8] def mkdir_p(path): |