Handle if the final NSP filepath already exists

This commit is contained in:
rlaphoenix
2022-11-12 09:20:18 +00:00
parent 95f9d64d54
commit 9056022065
+3
View File
@@ -228,6 +228,9 @@ def build(
return 2
nsp_final_path = Directories.output / f"{name} by {publisher} [{id_}].nsp"
if nsp_final_path.exists():
log.warning("An NSP forwarder of the same name, publisher and title ID already existed.")
nsp_final_path.unlink()
(Directories.output / f"{id_}.nsp").rename(nsp_final_path)
log.info(f"Done! The NSP has been saved to {nsp_final_path}")