From 7f1c319aee367be6ec7e7a11f92421d48ce3d0a5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 9 Apr 2024 11:23:38 +0400 Subject: [PATCH] Add interactive mode to prepare script. --- Telegram/build/prepare/prepare.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py index 8188b10f1..0f2a1d4f3 100644 --- a/Telegram/build/prepare/prepare.py +++ b/Telegram/build/prepare/prepare.py @@ -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)