Fix the check for Native Tools Command Prompt in prepare.py

This commit is contained in:
Ilya Fedin 2022-12-31 11:38:14 +04:00 committed by John Preston
parent 6c4dc34441
commit 322a085b70
1 changed files with 8 additions and 1 deletions

View File

@ -12,8 +12,15 @@ def error(text):
print('[ERROR] ' + text)
finish(1)
def nativeToolsError():
error('Make sure to run from Native Tools Command Prompt.')
win = (sys.platform == 'win32')
mac = (sys.platform == 'darwin')
if win and not 'Platform' in os.environ:
nativeToolsError()
win32 = win and (os.environ['Platform'] == 'x86')
win64 = win and (os.environ['Platform'] == 'x64')
@ -21,7 +28,7 @@ if win and not 'COMSPEC' in os.environ:
error('COMSPEC environment variable is not set.')
if win and not win32 and not win64:
error('Make sure to run from Native Tools Command Prompt.')
nativeToolsError()
os.chdir(scriptPath + '/../../../..')