Skip to content

Commit

Permalink
Support proerly deleting existing directories
Browse files Browse the repository at this point in the history
  • Loading branch information
markmaker committed Jan 8, 2024
1 parent d3c4ce4 commit 44dd4c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mesonbuild/scripts/cmake_run_ctgt.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ def run(argsv: T.List[str]) -> int:
do_copy = True

if do_copy:
if expected.exists():
expected.unlink()
if generated.is_dir():
if expected.exists():
shutil.rmtree(expected)
shutil.copytree(str(generated), str(expected))
else:
else :
if expected.exists():
expected.unlink()
shutil.copyfile(str(generated), str(expected))

return 0
Expand Down

0 comments on commit 44dd4c5

Please sign in to comment.