test(build): cleanup only when cache dir exists

This commit is contained in:
Maxim Prokhorov
2025-11-29 22:32:05 +03:00
parent 0ec63d9b76
commit 1c2154e1f9

View File

@@ -100,7 +100,8 @@ def cache_cleanup(cache_path: pathlib.Path, offset: datetime.timedelta):
def build_configurations(args: argparse.Namespace, configurations: list[pathlib.Path]):
cache_path = args.cache_path.resolve()
cache_cleanup(cache_path, args.expire_cache)
if cache_path.is_dir():
cache_cleanup(cache_path, args.expire_cache)
cmd = ["platformio", "run"]
if args.silent: