Skip to content

Instantly share code, notes, and snippets.

@sgtlaggy
Created November 11, 2024 21:38
Show Gist options
  • Save sgtlaggy/0780d907d318a2d702535380d3d9b4bd to your computer and use it in GitHub Desktop.
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.
#!/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