diff --git a/fastdl_sync/svencoop_lowercasing/lowercase_res_content.py b/fastdl_sync/svencoop_lowercasing/lowercase_res_content.py index 28c154d7..dbbc880c 100644 --- a/fastdl_sync/svencoop_lowercasing/lowercase_res_content.py +++ b/fastdl_sync/svencoop_lowercasing/lowercase_res_content.py @@ -1,16 +1,15 @@ -#!/bin/bash +#!/usr/bin/python3 -to_lowercase() { - find "$1" -depth -execdir rename 's/(.*)/\L$1/' {} + - ./lowercase_res_content.py -} +from pathlib import Path -to_lowercase "./svencoop_addon" - -inotifywait -m -r -e create -e moved_to -e modify --format '%w%f' "./svencoop_addon" | while read NEWFILE -do - echo "File change: $NEWFILE" - to_lowercase "./svencoop_addon" - sleep 1 -done +#we just lowercase each line in each res file so fastdl is fine with everything being lowercase. +def main(): + for p in Path("./svencoop_addon/maps/").glob('*.res'): #get all .res files in /maps + with open(p, 'r') as res: + lines = res.readlines() + with open(p, 'w') as res: + for line in lines: + res.write(line.lower()) +if __name__ == "__main__": + main()