Add interactive mode to prepare script.

This commit is contained in:
John Preston 2024-04-09 11:23:38 +04:00
parent 60805bd916
commit 7f1c319aee
1 changed files with 12 additions and 2 deletions

View File

@ -59,6 +59,9 @@ for arg in sys.argv[1:]:
options.append(arg)
elif arg == 'run':
customRunCommand = True
elif arg == 'shell':
customRunCommand = True
runCommand.append('shell')
buildQt5 = not 'skip-qt5' in options if win else 'build-qt5' in options
buildQt6 = 'build-qt6' in options if win else not 'skip-qt6' in options
@ -416,8 +419,15 @@ def runStages():
if customRunCommand:
os.chdir(executePath)
command = ' '.join(runCommand) + '\n'
if not run(command):
if len(runCommand) == 1 and runCommand[0] == 'shell':
print('Preparing interactive mode..')
if win:
modifiedEnv['PROMPT'] = '(prepare) $P$G'
subprocess.run("cmd.exe", shell=True, env=modifiedEnv)
else:
modifiedEnv['PS1'] = '(prepare) \\w \\$ '
subprocess.run("bash --noprofile --norc", env=modifiedEnv)
elif not run(command):
print('FAILED :(')
finish(1)
finish(0)