fix(install): cross-platform binary install + PATH conflict detection

install_binary() now:
1. Automatically picks best location per platform:
   - macOS: ~/.cargo/bin/ (no sudo, in PATH for Rust users)
   - Linux: ~/.cargo/bin/ → /usr/local/bin → ~/.local/bin/
   - Windows: /usr/local/bin (Git Bash/MSYS2)
2. Detects if old binary exists at a different PATH location
   and warns the user: 'There is ANOTHER gyandoot at ...'
3. Verifies 'command -v gyandoot' resolves correctly after install
4. Shows shell profile instructions if PATH needs updating

Previous issue: always installed to /usr/local/bin with sudo,
overwriting the old binary from install.sh but not warning if
another copy existed elsewhere in PATH.
This commit is contained in:
2026-06-13 18:26:39 +05:30
parent febc4b02c7
commit 3b5b995af8
2 changed files with 107 additions and 10 deletions

View File

@@ -408,7 +408,7 @@ async fn trigger_daemon_start(npx: &str, session: &str) -> Result<(), String> {
/// Find the daemon.js entrypoint in the globally installed camoufox-browser package.
/// Tries: npm root -g → find dist/daemon.js
async fn find_daemon_js(npx: &str) -> Result<std::path::PathBuf, String> {
async fn find_daemon_js(_npx: &str) -> Result<std::path::PathBuf, String> {
// Try `npm root -g` to find global node_modules
let root_output = Command::new("npm")
.args(&["root", "-g"])