From d177d8ff633fe04a685754d7b8f52a19a8e8c2bf Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 18 Jan 2024 13:04:50 +0530 Subject: [PATCH] fix: check if installed FF supports use-cached --- bench/utils/bench.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bench/utils/bench.py b/bench/utils/bench.py index 743318f0..7e0b111f 100644 --- a/bench/utils/bench.py +++ b/bench/utils/bench.py @@ -354,11 +354,17 @@ def build_assets(bench_path=".", app=None, using_cached=False): if app: command += f" --app {app}" - if using_cached: + if using_cached and can_use_cached(bench_path): command += " --using-cached" exec_cmd(command, cwd=bench_path, env={"BENCH_DEVELOPER": "1"}) +def can_use_cached(bench_path=".") -> bool: + cmd = ["bench", "can-use-cached"] + return_code = subprocess.call( + cmd, cwd=bench_path, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, + ) + return not return_code def handle_version_upgrade(version_upgrade, bench_path, force, reset, conf): from bench.utils import log, pause_exec