mirror of
https://github.com/Threnklyn/nton.git
synced 2026-06-07 13:43:32 +02:00
Handle if the final NSP filepath already exists
This commit is contained in:
@@ -228,6 +228,9 @@ def build(
|
|||||||
return 2
|
return 2
|
||||||
|
|
||||||
nsp_final_path = Directories.output / f"{name} by {publisher} [{id_}].nsp"
|
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)
|
(Directories.output / f"{id_}.nsp").rename(nsp_final_path)
|
||||||
|
|
||||||
log.info(f"Done! The NSP has been saved to {nsp_final_path}")
|
log.info(f"Done! The NSP has been saved to {nsp_final_path}")
|
||||||
|
|||||||
Reference in New Issue
Block a user