Skip to content

Commit

Permalink
Add interactive mode to prepare script.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Apr 9, 2024
1 parent 60805bd commit 7f1c319
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Telegram/build/prepare/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def nativeToolsError():
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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7f1c319

Please sign in to comment.