From dc51a41d457a63298a76b6da816de1994d11feb8 Mon Sep 17 00:00:00 2001 From: Muffin Date: Wed, 21 Feb 2024 12:22:55 -0600 Subject: [PATCH] Rewrite trampoline.turbowarp.org -> trampoline.turbowarp.xyz --- patch.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/patch.py b/patch.py index 65d7f35..dd3f7e3 100644 --- a/patch.py +++ b/patch.py @@ -3,13 +3,21 @@ import shutil for path in glob.glob('scratch-gui/build/*.html'): - with open(path, 'r') as fr: - print(f"Patching HTML {path}") - contents = fr.read() + print(f'Patching HTML {path}') + with open(path, 'r') as f: + contents = f.read() contents = contents.replace('', '') contents = contents.replace('', '') - with open(path, 'w') as fw: - fw.write(contents) + with open(path, 'w') as f: + f.write(contents) + +for path in glob.glob('scratch-gui/build/js/*.js'): + print(f'Patching JS {path}') + with open(path, 'r') as f: + contents = f.read() + contents = contents.replace('https://trampoline.turbowarp.org', 'https://trampoline.turbowarp.xyz') + with open(path, 'w') as f: + f.write(contents) os.remove('scratch-gui/build/sw.js') os.remove('scratch-gui/build/manifest.webmanifest')