fix(install): add --yes flag to npx so it doesn't hang waiting for prompt
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)
This commit is contained in:
19
install.sh
19
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"
|
||||
|
||||
Reference in New Issue
Block a user