Skip to content

Commit

Permalink
Rewrite trampoline.turbowarp.org -> trampoline.turbowarp.xyz
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Feb 21, 2024
1 parent 41e9db7 commit dc51a41
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('</head>', '<meta name="robots" content="noindex"></head>')
contents = contents.replace('<link rel="manifest" href="manifest.webmanifest">', '')
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')
Expand Down

0 comments on commit dc51a41

Please sign in to comment.