From d993ab7b482339f3b00b41f81d27e2e5eda3adbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Cezar=20Mois=C3=A9s?= Date: Fri, 3 Jan 2025 23:02:38 +0000 Subject: [PATCH] Update update_newtab.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cristian Cezar Moisés --- scripts/update_newtab.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/update_newtab.py b/scripts/update_newtab.py index e98a8ec6..85ba491f 100644 --- a/scripts/update_newtab.py +++ b/scripts/update_newtab.py @@ -1,9 +1,19 @@ import os +import subprocess def update_newtab(init: bool = True): + # Change to the newtab directory and install dependencies if initializing if init: - os.system("(cd ./engine/browser/components/newtab && ../../../mach npm install && ../../../mach npm install meow@9.0.0)") - os.system("cd ./engine && ./mach npm run bundle --prefix=browser/components/newtab") + subprocess.run( + ["sh", "-c", "(cd ./engine/browser/components/newtab && ../../../mach npm install && ../../../mach npm install meow@9.0.0)"], + check=True + ) + + # Bundle the newtab components + subprocess.run( + ["sh", "-c", "cd ./engine && ./mach npm run bundle --prefix=browser/components/newtab"], + check=True + ) if __name__ == "__main__": update_newtab(False)