Skip to content

Commit

Permalink
pw_package: Fix pictotool install on mac
Browse files Browse the repository at this point in the history
Ensure the picotool target directory exists before copy

Change-Id: I0e39ef7869fbee7ee5976a9e7f31d26f1a3f0018
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234238
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Armando Montanez <[email protected]>
Pigweed-Auto-Submit: Dave Roth <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
  • Loading branch information
davexroth authored and CQ Bot Account committed Sep 5, 2024
1 parent 1eb0901 commit 7e9104f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pw_package/py/pw_package/packages/picotool.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@

def force_copy(source: Path, destination: Path):
_LOG.info('Copy %s -> %s', source, destination)
# ensure the destination directory exists
# otherwise the copy will fail on mac.
dirname = os.path.dirname(destination)
if not os.path.isdir(dirname):
os.makedirs(dirname)
destination.unlink(missing_ok=True)
shutil.copy(source, destination)

Expand Down

0 comments on commit 7e9104f

Please sign in to comment.