Skip to content

Commit

Permalink
Also remove installation dir with build --clean (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Dec 1, 2022
2 parents bf9a87e + ad5a293 commit e65f153
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions devpy/cmds/_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ def build(build_dir, meson_args, jobs=None, clean=False, verbose=False):
"""
build_dir = os.path.abspath(build_dir)
inst_dir = install_dir(build_dir)
build_cmd = ["meson", "setup", build_dir, "--prefix=/usr"] + list(meson_args)
flags = []

if clean:
print(f"Removing `{build_dir}`")
if os.path.isdir(build_dir):
shutil.rmtree(build_dir)
print(f"Removing `{inst_dir}`")
if os.path.isdir(inst_dir):
shutil.rmtree(inst_dir)

if os.path.exists(build_dir):
flags += ["--reconfigure"]
Expand Down

0 comments on commit e65f153

Please sign in to comment.