From ba3c63749d5cb3b9b11a5d37afae5d78f41c72a8 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 16 Mar 2026 11:49:45 -0400 Subject: [PATCH] fix(install): remove stale binary when pipx/pip fallback succeeds A failed binary download (or leftover from a previous install) at ~/.local/bin/voxvera shadows the pipx/pip entrypoint script. Now all non-binary strategies detect and remove stale ELF/Mach-O binaries before declaring success. Co-Authored-By: Claude Opus 4.6 --- install.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 099b01e..74dc949 100755 --- a/install.sh +++ b/install.sh @@ -242,6 +242,17 @@ install_binary() { return 1 } +# --- Helper: remove stale standalone binary so it doesn't shadow pipx/pip entrypoints --- +cleanup_stale_binary() { + local bin="$HOME/.local/bin/voxvera" + [ -f "$bin" ] || return 0 + # If the file is a real binary (not a pipx/pip script), remove it + if file "$bin" 2>/dev/null | grep -qiE 'ELF|executable|Mach-O'; then + warn "Removing stale standalone binary at $bin (would shadow pipx/pip entrypoint)" + rm -f "$bin" + fi +} + # ============================================================ # Strategy 2: pipx from git (isolated venv) # ============================================================ @@ -251,6 +262,7 @@ install_pipx() { if pipx install --force "voxvera@git+${REPO_URL}.git@${BRANCH}"; then pipx inject voxvera setuptools 2>/dev/null || true pipx ensurepath --force + cleanup_stale_binary msg "\nVoxVera installed/updated successfully via pipx." msg "IMPORTANT: Please restart your terminal or run 'source ~/.bashrc' (or your shell config) to use 'voxvera'." return 0 @@ -267,6 +279,7 @@ install_pip_git() { local flags flags=$(pip_flags) if pip install $flags "voxvera@git+${REPO_URL}.git@${BRANCH}"; then + cleanup_stale_binary msg "VoxVera installed via pip." return 0 fi @@ -278,7 +291,7 @@ install_pip_git() { # Strategy 4: GitHub tarball (no git clone needed — most resilient) # ============================================================ install_tarball() { - install_from_tarball && return 0 + if install_from_tarball; then cleanup_stale_binary; return 0; fi warn "Tarball install failed. Trying next method..." return 1 } @@ -287,7 +300,7 @@ install_tarball() { # Strategy 5: Shallow clone + local pip install # ============================================================ install_shallow() { - install_from_shallow_clone && return 0 + if install_from_shallow_clone; then cleanup_stale_binary; return 0; fi warn "Shallow clone install failed." return 1 }