From 0334cad50e99051012543ea5df9fdc22c3305631 Mon Sep 17 00:00:00 2001 From: Tara Menon Date: Sat, 13 Jun 2026 07:31:51 +0530 Subject: [PATCH] fix(install): add --yes flag to npx so it doesn't hang waiting for prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: 'npx camoufox-js@0.11.0 fetch' on a fresh install prompts 'Ok to proceed? (y/N)' and pipes it through 'tail -5', hiding it. User sees nothing happening while script waits for input. Fix: 1. npx --yes — auto-confirms the install prompt, no more silent hang 2. Removed | tail -5 — full output visible so user sees progress bar 3. macOS cache path (~/Library/Caches/) vs Linux (~/.cache/) in verify step 4. Also checks version.json as fallback (binary can be named differently) --- install.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 721f672..11cd6af 100755 --- a/install.sh +++ b/install.sh @@ -195,13 +195,24 @@ install_camofox_browser() { npm install -g camoufox-browser@0.1.0 2>&1 | tail -3 info "Downloading Camoufox browser binary (this may take a while, ~662MB)..." - npx camoufox-js@0.11.0 fetch 2>&1 | tail -5 + info "Running: npx --yes camoufox-js@0.11.0 fetch" + npx --yes camoufox-js@0.11.0 fetch 2>&1 # Verify the browser binary was actually downloaded - if ls ~/.cache/camoufox/camoufox 2>/dev/null; then - ok "Camoufox browser binary downloaded (~/.cache/camoufox/)" + # macOS: ~/Library/Caches/camoufox/ | Linux: ~/.cache/camoufox/ + local cache_dir + if [ "$(uname -s)" = "Darwin" ]; then + cache_dir="$HOME/Library/Caches/camoufox" else - warn "Browser binary not found at ~/.cache/camoufox/. May need manual 'npx camoufox-js@0.11.0 fetch'" + cache_dir="$HOME/.cache/camoufox" + fi + + if [ -f "$cache_dir/camoufox" ]; then + ok "Camoufox browser binary downloaded ($cache_dir/)" + elif [ -f "$cache_dir/version.json" ]; then + ok "Camoufox browser cache found at $cache_dir/ (binary downloaded)" + else + warn "Browser binary not found at $cache_dir/. May need manual 'npx --yes camoufox-js@0.11.0 fetch'" fi ok "Camoufox browser npm package installed"