Created
November 11, 2024 21:38
-
-
Save sgtlaggy/0780d907d318a2d702535380d3d9b4bd to your computer and use it in GitHub Desktop.
Remove auto-generated `.js` and `.js.map` files from SPT server mods. Mostly for linux users.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from pathlib import Path | |
GAME = Path(__file__).parent | |
MODS = GAME / 'user' / 'mods' | |
for ts in MODS.rglob('*.ts'): | |
js = ts.with_suffix('.js') | |
map = ts.with_suffix('.js.map') | |
if js.exists(): | |
print(f'Deleting {js.relative_to(MODS)}') | |
js.unlink() | |
if map.exists(): | |
print(f'Deleting {map.relative_to(MODS)}') | |
map.unlink() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment