--version now displays the correct (new-form) version number
This commit is contained in:
@@ -242,14 +242,15 @@ def main():
|
|||||||
options.verbose > 0)
|
options.verbose > 0)
|
||||||
|
|
||||||
if options.version:
|
if options.version:
|
||||||
|
print "Minecraft Overviewer %s" % util.findGitVersion(),
|
||||||
|
print "(%s)" % util.findGitHash()[:7]
|
||||||
try:
|
try:
|
||||||
import overviewer_core.overviewer_version as overviewer_version
|
import overviewer_core.overviewer_version as overviewer_version
|
||||||
print "Minecraft-Overviewer %s" % overviewer_version.VERSION
|
|
||||||
print "Git commit: %s" % overviewer_version.HASH
|
|
||||||
print "built on %s" % overviewer_version.BUILD_DATE
|
print "built on %s" % overviewer_version.BUILD_DATE
|
||||||
print "Build machine: %s %s" % (overviewer_version.BUILD_PLATFORM, overviewer_version.BUILD_OS)
|
if options.verbose > 0:
|
||||||
except Exception:
|
print "Build machine: %s %s" % (overviewer_version.BUILD_PLATFORM, overviewer_version.BUILD_OS)
|
||||||
print "version info not found"
|
except ImportError:
|
||||||
|
print "(build info not found)"
|
||||||
pass
|
pass
|
||||||
doExit(code=0, consoleMsg=False)
|
doExit(code=0, consoleMsg=False)
|
||||||
|
|
||||||
|
|||||||
@@ -69,10 +69,17 @@ def findGitVersion():
|
|||||||
line = line.split('-', 1)[1]
|
line = line.split('-', 1)[1]
|
||||||
if line.startswith('v'):
|
if line.startswith('v'):
|
||||||
line = line[1:]
|
line = line[1:]
|
||||||
# turn 0.1.2-50-somehash into 0.1.2-50
|
# turn 0.1.0-50-somehash into 0.1.50
|
||||||
# and 0.1.3 into 0.1.3
|
# and 0.1.0 into 0.1.0
|
||||||
line = '-'.join(line.split('-', 2)[:2])
|
line = line.strip().replace('-', '.').split('.')
|
||||||
return line.strip()
|
if len(line) == 5:
|
||||||
|
del line[4]
|
||||||
|
del line[2]
|
||||||
|
else:
|
||||||
|
assert len(line) == 3
|
||||||
|
line[2] = '0'
|
||||||
|
line = '.'.join(line)
|
||||||
|
return line
|
||||||
except Exception:
|
except Exception:
|
||||||
try:
|
try:
|
||||||
import overviewer_version
|
import overviewer_version
|
||||||
|
|||||||
Reference in New Issue
Block a user