Fix for when invalid version is requested

This commit is contained in:
gpugh 2018-12-13 00:49:32 +01:00
parent 2a739b16d3
commit 75577caa87

View File

@ -694,14 +694,25 @@ def main():
exit(0) exit(0)
else: else:
print '\nBuild %s available. Downloading #%s...\n' % (os_build, answer) print '\nBuild %s available. Downloading #%s...\n' % (os_build, answer)
elif args.auto or args.version: elif args.version:
try: try:
answer answer
except NameError: except NameError:
print ('\n' print ('\n'
'Item # %s is not available. ' 'Item # %s is not available. '
'Run again without --version argument '
'to select a valid build to download.\n' % args.version)
exit(0)
else:
print '\nBuild %s selected. Downloading #%s...\n' % (lowest_valid_build, answer)
elif args.auto:
try:
answer
except NameError:
print ('\n'
'No valid version available. '
'Run again without --auto argument ' 'Run again without --auto argument '
'to select a valid build to download.\n' % answer) 'to select a valid build to download.\n')
exit(0) exit(0)
else: else:
print '\nBuild %s selected. Downloading #%s...\n' % (lowest_valid_build, answer) print '\nBuild %s selected. Downloading #%s...\n' % (lowest_valid_build, answer)