[TASK] Incremental increase of project folders if name already uses

This commit is contained in:
kairoto committed 2026-09-17 17:38:55 +02:00
1 parent 8a306f0e33
commit e31d5023b3
1 file changed
+6 -2
+6 -2
View File
@@ -24,9 +24,13 @@ if not path.exists() and path.is_file() :
counter = 0
for subpath in path.iterdir() :
if subpath.name == args.name :
while True :
checkablePath = args.name if counter == 0 else args.name + str(counter)
subpath = path.joinpath(checkablePath)
if subpath.exists() :
counter += 1
else :
break
if counter != 0 :
path = Path(path.absolute().as_posix() + f"/{args.name}" + str(counter))