mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
fix(lint): bound the mermaid browser provisioning and recover from a cut-off install
The chrome-headless-shell download had no time limit, so a stalled network kept lint-mermaid, and with it the whole quality gate, waiting for 148 minutes. The install now runs under a 900 second timeout. An interrupted download leaves the browser folder without its executable, and puppeteer then refuses every later install of that build. A failed provisioning therefore clears the puppeteer browser cache once and tries again before falling back to the existing warning. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
0f0492aa59
commit
2f5f52bd1a
1 file changed
+12
-3
+12
-3
@@ -29,9 +29,18 @@ if command -v apt-get >/dev/null 2>&1; then
|
||||
echo "Warning: apt-get update failed; chrome's shared libs may stay unresolved." >&2
|
||||
fi
|
||||
|
||||
if ! deps_output="$(npx --yes puppeteer browsers install chrome-headless-shell --install-deps 2>&1)"; then
|
||||
printf 'Warning: chrome-headless-shell provisioning failed; mermaid rendering may fail:\n%s\n' \
|
||||
"${deps_output}" >&2
|
||||
provision_browser() {
|
||||
timeout 900 npx --yes puppeteer browsers install chrome-headless-shell --install-deps 2>&1
|
||||
}
|
||||
|
||||
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
|
||||
if ! deps_output="$(provision_browser)"; then
|
||||
printf 'Warning: chrome-headless-shell provisioning failed; mermaid rendering may fail:\n%s\n' \
|
||||
"${deps_output}" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
workdir="$(mktemp -d)"
|
||||
|
||||
Reference in new issue
Block a user