mirror of
https://github.com/LouisShark/chatgpt_system_prompt.git
synced 2025-07-05 14:20:33 -04:00
Update idxtool.py
allow renaming of unchecked files
This commit is contained in:
parent
abb63eb208
commit
9e2f99c8de
1 changed files with 9 additions and 0 deletions
|
@ -41,6 +41,15 @@ def rename_gpts():
|
||||||
print(f"[+] {basename} -> {os.path.basename(new_fn)}")
|
print(f"[+] {basename} -> {os.path.basename(new_fn)}")
|
||||||
if os.system(f"git mv \"{gpt.filename}\" \"{new_fn}\"") == 0:
|
if os.system(f"git mv \"{gpt.filename}\" \"{new_fn}\"") == 0:
|
||||||
nb_ok += 1
|
nb_ok += 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
# If git mv failed, then try os.rename
|
||||||
|
try:
|
||||||
|
os.rename(gpt.filename, new_fn)
|
||||||
|
nb_ok += 1
|
||||||
|
continue
|
||||||
|
except OSError as e:
|
||||||
|
print(f"Rename error: {e.strerror}")
|
||||||
|
|
||||||
msg = f"Renamed {nb_ok} out of {nb_total} GPT files."
|
msg = f"Renamed {nb_ok} out of {nb_total} GPT files."
|
||||||
ok = nb_ok == nb_total
|
ok = nb_ok == nb_total
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue