Last active
May 5, 2022 16:30
-
-
Save Specnr/8a572ac5c5cfdb54eb0dc7d1eb2906a3 to your computer and use it in GitHub Desktop.
DELETES all worlds called New World or Speedrun # in all instances
This file contains 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
import shutil | |
import glob | |
import os | |
# Edit this | |
INST_FOLDER = "C:/MultiInstanceMC/MultiMC/instances" | |
with open("bop.log", "w") as log: | |
files = glob.glob(f'{INST_FOLDER}/*/.minecraft/saves/*') | |
for f in files: | |
if os.path.isdir(f) and ("New World" in f or "Speedrun #" in f): | |
log.write("Deleting: " + f + "\n") | |
shutil.rmtree(f) | |
else: | |
log.write("Skipping: " + f + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment