Do not clean lock files in top and run dirs if no-lock opts are set

This commit is contained in:
Adriano Scoditti 2019-06-26 10:59:17 +02:00
parent b7a6114ac7
commit 9e59917ee0
1 changed files with 6 additions and 1 deletions

View File

@ -332,7 +332,12 @@ def distclean(ctx):
else:
remove_and_log(env.out_dir, shutil.rmtree)
for k in (env.out_dir, env.top_dir, env.run_dir):
env_dirs = [env.out_dir]
if not ctx.options.no_lock_in_top:
env_dirs.append(env.top_dir)
if not ctx.options.no_lock_in_run:
env_dirs.append(env.run_dir)
for k in env_dirs:
p = os.path.join(k, Options.lockfile)
remove_and_log(p, os.remove)