From 28f85eb710cece0fed881cb3a19d687375f52558 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 1 Nov 2021 11:51:49 +0400 Subject: [PATCH] Allow running custom commands through prepare script. --- Telegram/build/prepare/prepare.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py index a06d3e297..ca0d07cd1 100644 --- a/Telegram/build/prepare/prepare.py +++ b/Telegram/build/prepare/prepare.py @@ -44,9 +44,15 @@ optionsList = [ 'build-stackwalk', ] options = [] +runCommand = [] +customRunCommand = False for arg in sys.argv[1:]: + if customRunCommand: + runCommand.append(arg) if arg in optionsList: options.append(arg) + elif arg == 'run': + customRunCommand = True 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 @@ -384,6 +390,14 @@ def runStages(): finish(1) writeCacheKey(stage) +if customRunCommand: + os.chdir(executePath) + command = ' '.join(runCommand) + '\n' + if not run(command): + print('FAILED :(') + finish(1) + finish(0) + stage('patches', """ git clone https://github.com/desktop-app/patches.git cd patches