Skip to content

fix: use which instead of where for command detection on Linux#54

Open
adamdaw wants to merge 1 commit intolangwatch:mainfrom
adamdaw:fix/linux-command-detection
Open

fix: use which instead of where for command detection on Linux#54
adamdaw wants to merge 1 commit intolangwatch:mainfrom
adamdaw:fix/linux-command-detection

Conversation

@adamdaw
Copy link
Copy Markdown

@adamdaw adamdaw commented Apr 8, 2026

Fix command detection on native Linux

Problem

The command_exists function in lib.rs uses the where command to check for installed dependencies (Claude Code, git, gh). where is Windows-only — on Linux it doesn't exist, so all dependency checks fail silently and the onboarding wizard reports everything as "not found" regardless of what's actually installed.

This affects anyone running the Tauri build on native Linux (e.g. Ubuntu, Pop_OS, Fedora). WSL users are unaffected since they're running a Windows host binary.

A second related issue: even after switching to which, Tauri apps on Linux launch with a stripped PATH that excludes common user bin directories. This means binaries installed via npm (~/.local/bin), nvm (~/.nvm/versions/node/*/bin), or manually to /usr/local/bin won't be found by a plain which call.

Fix

  • Use which instead of where on non-Windows targets
  • On Linux, explicitly check common user bin locations before falling back to which:
    • ~/.local/bin (default npm global bin on many distros)
    • /usr/local/bin
    • /usr/bin
    • ~/.nvm/versions/node/*/bin (any installed nvm node version)

Testing

Tested on Pop_OS 22.04 with:

  • Node 23.11.0 managed via nvm
  • Claude Code 2.1.92 installed globally via npm (binary at ~/.local/bin/claude)
  • Rust 1.90.0

All three dependency checks (Claude Code, git, gh) now correctly resolve after this fix.

The command_exists function used the Windows-only `where` command,
causing all dependency checks (claude, git, gh) to fail silently on Linux.

Fix:
- Use `which` on non-Windows targets
- Add explicit path checks for common Linux user bin locations
  (~/.local/bin, /usr/local/bin) and nvm-managed node bin dirs,
  since Tauri apps launch with a stripped PATH that excludes these

Tested on Pop_OS 22.04.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant