Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
622 B
2
Indexable
Never
import os

onlyRename = False

fileBefore = "mythril"
fileAfter = "mythril"

inBefore = "minecraft:block/mythril"
inAfter = "flufam:block/mythril"


path = "C:/Us~ers/karti/Desktop/FFW/src/main/resources/assets/flufam/models/block/script/"

a = os.listdir(path)

print(a)

for i in a:
    if i == "script.py":
        continue

    os.rename(path + i, path + i.replace(fileBefore, fileAfter))

    if not onlyRename:
        with open(i, 'r') as f:
            a = f.read()
            a = a.replace(inBefore, inAfter)

        with open(i, 'w') as w:
            w.write(a)

print("done")