Skip to content

Commit

Permalink
romtool: issue an error/warning if ROM was not written
Browse files Browse the repository at this point in the history
  • Loading branch information
cnvogelg committed Jan 3, 2024
1 parent a34565b commit 95619f9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions amitools/tools/romtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def do_split_cmd(args):
# no output dir? end now
out_path = args.output_dir
if out_path is None:
logging.error("No -o output given. Can't split ROM!")
return 0
# get modules to export
if args.modules is None:
Expand Down Expand Up @@ -210,6 +211,8 @@ def do_build_cmd(args):
logging.info("saving ROM to '%s'", output)
with open(output, "wb") as fh:
fh.write(rom_data)
else:
logging.warn("No output -o given! ROM not saved!")
return 0


Expand Down Expand Up @@ -341,6 +344,8 @@ def do_patch_cmd(args):
logging.info("saving ROM to '%s'", output)
with open(output, "wb") as fh:
fh.write(rom_data)
else:
logging.warn("No output -o given! ROM not saved!")
return 0


Expand Down Expand Up @@ -393,6 +398,8 @@ def do_combine_cmd(args):
logging.info("saving ROM to '%s'", output)
with open(output, "wb") as fh:
fh.write(rom_img)
else:
logging.warn("No output -o given! ROM not saved!")
return 0


Expand Down

0 comments on commit 95619f9

Please sign in to comment.