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"