Add windowsPaths setting

This commit is contained in:
Fierelier 2021-09-26 04:31:55 +02:00
parent 4ffb1f2f7a
commit 710c68a933
2 changed files with 12 additions and 5 deletions

View File

@ -3,4 +3,7 @@
# - hardlink: the default. simply links file from one point to another, imagine it like a shortcut, just that changes made also result in the original file getting changed. if you use this method, and you want to change a file inside the modded game, always duplicate it, delete the original (inside your modded game), and rename it to the original file. to stay safe, you should always mod files using the modloader.
# - reflink: this method uses a feature in certain copy-on-write file systems, like btrfs, which allows you to make a "link" of a file, similar to hardlinks, but you can edit it as well. only changes are saved additionally. note that btrfs and other filesystems that support this feature don't tend to be the default filesystem in many operating systems. this has implementations for linux, and btrfs on windows (https://github.com/maharmstone/btrfs)
# - copy: copy the files. this takes longer and requires more space, but also makes it possible for you to edit the files afterwards without the use of the modloader.
linkMethod = hardlink
linkMethod = hardlink
# use windows compatible paths (case-insensitive)
windowsPaths = true

View File

@ -120,17 +120,21 @@ def cloneFolder(src,dst):
ffile = p(root,file)
lfile = ffile.replace(src + os.path.sep,"",1)
nfile = p(dst,lfile)
if nfile in listLinkedFolders: continue
nnfile = nfile
if config["default"]["windowsPaths"] == "true": nnfile = nnfile.lower()
if nnfile in listLinkedFolders: continue
os.makedirs(nfile)
listLinkedFolders.append(nfile)
listLinkedFolders.append(nnfile)
for file in files:
ffile = p(root,file)
lfile = ffile.replace(src + os.path.sep,"",1)
nfile = p(dst,lfile)
if nfile in listLinked: continue
nnfile = nfile
if config["default"]["windowsPaths"] == "true": nnfile = nnfile.lower()
if nnfile in listLinked: continue
linkFile(ffile,nfile)
listLinked.append(nfile)
listLinked.append(nnfile)
def loadMods():
print("")