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) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5 committed 2026-09-21 23:35:26 +02:00
1 parent e794f98c5a
commit dc67bce5f0
1 file changed
+1 -3
+1 -3
View File
@@ -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