Skip to content

Commit

Permalink
extractodx: Create outdir if not present
Browse files Browse the repository at this point in the history
Allows binaries to be extracted to `--outdir` without having to manually create it.
  • Loading branch information
JaCzekanski authored Feb 7, 2024
1 parent 60c81fd commit 6668b04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extractodx.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def extract_odx(odx_string, flash_info: constants.FlashInfo, is_dsg=False):
file_data = Path(args.file).read_text()

(data_blocks, allowed_boxcodes) = extract_odx(file_data, flash_info, args.dsg)
os.makedirs(args.outdir, exist_ok=True)

for data_block in data_blocks:
print(data_block)
with open(os.path.join(args.outdir, data_block), "wb") as dataFile:
Expand Down

0 comments on commit 6668b04

Please sign in to comment.