outputs = {
config.output_dir_or_cwd() / output
for output in config.outputs
- if (config.output_dir_or_cwd() / output).exists()
+ if (config.output_dir_or_cwd() / output).exists() or (config.output_dir_or_cwd() / output).is_symlink()
}
# Make sure we resolve the symlink we create in the output directory and remove its target as well as it might
stdout=subprocess.DEVNULL if not ARG_DEBUG.get() else None,
stderr=subprocess.DEVNULL if not ARG_DEBUG.get() else None)
- filtered = sorted({p for p in paths if p.exists()})
+ filtered = sorted({p for p in paths if p.exists() or p.is_symlink()})
if filtered:
run(["rm", "-rf", "--", *filtered],
sandbox=sandbox(binary="rm", mounts=[Mount(p.parent, p.parent) for p in filtered]))