Created
December 13, 2016 22:12
-
-
Save thurask/5442208f6028fd09169b54f18f9349f5 to your computer and use it in GitHub Desktop.
Fix plugins.txt for Merge Plugins Standalone
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
import os | |
import shutil | |
def set_merge_txt(): | |
with open("plugins.txt", "r") as x: | |
data = x.readlines() | |
data[2:2] = ['*Fallout4.esm\n', '*DLCRobot.esm\n', '*DLCworkshop01.esm\n', '*DLCCoast.esm\n', '*DLCworkshop02.esm\n', '*DLCworkshop03.esm\n', '*DLCNukaWorld.esm\n'] | |
shutil.move("plugins.txt", "plugins.txt.bak") | |
with open("plugins.txt", "w") as x: | |
x.writelines(data) | |
def unset_merge_txt(): | |
os.remove("plugins.txt") | |
shutil.move("plugins.txt.bak", "plugins.txt") | |
if __name__ == "__main__": | |
if os.path.exists("plugins.txt.bak") and os.path.exists("plugins.txt"): | |
unset_merge_txt() | |
else: | |
set_merge_txt() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment