fix(install): support VOX_INSTALL_DIR and fall back to ~/.local/bin without sudo#71
Merged
Merged
Conversation
…ithout sudo - VOX_INSTALL_DIR env var overrides the hardcoded /usr/local/bin - when the target dir is not writable, only use sudo if it can actually work (cached credentials or a usable /dev/tty); otherwise fall back to ~/.local/bin instead of dying on "sudo: A terminal is required" - an explicitly requested dir never falls back: fail with a clear error - chmod the binary before moving it, since after `sudo mv` the invoking user may no longer be able to chmod it Fixes #70 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #70
Changes
VOX_INSTALL_DIRenv var overrides the hardcoded/usr/local/bin:curl -fsSL .../install.sh | VOX_INSTALL_DIR=~/.local/bin sh/dev/ttyfor the password prompt). Otherwise the installer falls back to~/.local/bininstead of dying onsudo: A terminal is required to authenticate.VOX_INSTALL_DIRnever silently falls back: if it is not writable and sudo is unavailable, the installer fails with a clear error.chmod +x-ed before the move: the previous post-sudo mvchmod ran as the invoking user on a file that may no longer belong to them.Testing (Linux x86_64, no interactive sudo, piped
cat install.sh | shlike real usage)VOX_INSTALL_DIR=<tmp>/bin→ installed there, no sudo, binary runs (vox 0.15.0)$HOME/.local/bin, binary runs (this is the exact failure mode from install.sh: support custom install dir instead of hardcoded /usr/local/bin (fails without interactive sudo) #70)VOX_INSTALL_DIR=/usr/lib/voxtest(unwritable), no sudo → exits 1 with a clear error, no fallbackNot tested here: the interactive-sudo path (no sudo available in this environment); that branch is unchanged in spirit from the previous behavior.
🤖 Generated with Claude Code