From dc67bce5f05b1419eb5048a6776cbf611d6ab71c Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 23:35:26 +0200 Subject: [PATCH] fix(lint): delete the half-installed browser instead of asking puppeteer to The recovery added in 2f5f52bd1 ran 'npx puppeteer browsers clear', which asks yes/No on stdin and deletes nothing without a terminal. A cut-off download therefore still left chrome-headless-shell without its executable, and puppeteer kept refusing every later install of that build, so lint-mermaid failed on every run. A failed provisioning now removes the chrome-headless-shell cache folder itself, the step puppeteer's own error message asks for, and retries. Against a stack whose cache still held the broken folder, all 287 Markdown files rendered. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/lint/mermaid.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/lint/mermaid.sh b/scripts/lint/mermaid.sh index c6391e1850..5e81449af6 100755 --- a/scripts/lint/mermaid.sh +++ b/scripts/lint/mermaid.sh @@ -34,9 +34,7 @@ provision_browser() { } if ! deps_output="$(provision_browser)"; then - # Exception: a cut-off install leaves a browser folder without its executable, and puppeteer refuses every later install until the cache is cleared. - npx --yes puppeteer browsers clear >/dev/null 2>&1 || - echo "Warning: clearing the puppeteer browser cache failed." >&2 + rm -rf "${PUPPETEER_CACHE_DIR:-${HOME}/.cache/puppeteer}/chrome-headless-shell" if ! deps_output="$(provision_browser)"; then printf 'Warning: chrome-headless-shell provisioning failed; mermaid rendering may fail:\n%s\n' \ "${deps_output}" >&2