mirror of
https://github.com/Threnklyn/nton.git
synced 2026-06-07 13:43:32 +02:00
Fix output file exists and size checks in nstool funcs
This commit is contained in:
+4
-4
@@ -58,9 +58,9 @@ def get_nacp(asset_path: Path, output_path: Path) -> str | int | None:
|
|||||||
"--nacp", output_path,
|
"--nacp", output_path,
|
||||||
asset_path
|
asset_path
|
||||||
])
|
])
|
||||||
if not asset_path.is_file():
|
if not output_path.is_file():
|
||||||
return "No NACP was extracted from the asset."
|
return "No NACP was extracted from the asset."
|
||||||
if asset_path.stat().st_size <= 2:
|
if output_path.stat().st_size <= 2:
|
||||||
return "An empty NACP was extracted from the asset."
|
return "An empty NACP was extracted from the asset."
|
||||||
return None
|
return None
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
@@ -84,9 +84,9 @@ def get_icon(asset_path: Path, output_path: Path) -> str | int | None:
|
|||||||
"--icon", output_path,
|
"--icon", output_path,
|
||||||
asset_path
|
asset_path
|
||||||
])
|
])
|
||||||
if not asset_path.is_file():
|
if not output_path.is_file():
|
||||||
return "No Icon was extracted from the asset."
|
return "No Icon was extracted from the asset."
|
||||||
if asset_path.stat().st_size <= 2:
|
if output_path.stat().st_size <= 2:
|
||||||
return "An empty Icon was extracted from the asset."
|
return "An empty Icon was extracted from the asset."
|
||||||
return None
|
return None
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user