From 7ebe18cb462149fa9c8822aaa1d8c072b2e3570a Mon Sep 17 00:00:00 2001 From: Nico Rumpeltin Date: Fri, 20 Sep 2024 14:27:08 +0200 Subject: [PATCH] Added --clean flag to fusesoc run command --- fusesoc/main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fusesoc/main.py b/fusesoc/main.py index 197b71c7..7086dff2 100644 --- a/fusesoc/main.py +++ b/fusesoc/main.py @@ -315,8 +315,8 @@ def run(fs, args): exit(1) # Unconditionally clean out the work root on fresh builds - # if we use the old tool API - if do_configure and not core.get_flow(flags): + # if we use the old tool API or clean flag is set + if do_configure and (not core.get_flow(flags) or args.clean): try: prepare_work_root(fs.get_work_root(core, flags)) except RuntimeError as e: @@ -568,6 +568,11 @@ def get_parser(): # run subparser parser_run = subparsers.add_parser("run", help="Start a tool flow") + parser_run.add_argument( + "--clean", + action="store_true", + help="Clean build directory on start", + ) parser_run.add_argument( "--no-export", action="store_true",