Skip to content

fix(install): support VOX_INSTALL_DIR and fall back to ~/.local/bin without sudo#71

Merged
pszymkowiak merged 1 commit into
mainfrom
fix/install-dir-override
Jul 9, 2026
Merged

fix(install): support VOX_INSTALL_DIR and fall back to ~/.local/bin without sudo#71
pszymkowiak merged 1 commit into
mainfrom
fix/install-dir-override

Conversation

@pszymkowiak

Copy link
Copy Markdown
Contributor

Fixes #70

Changes

  • VOX_INSTALL_DIR env var overrides the hardcoded /usr/local/bin:
    curl -fsSL .../install.sh | VOX_INSTALL_DIR=~/.local/bin sh
  • When the target dir is not writable, sudo is only used if it can actually work (cached/passwordless credentials, or a usable /dev/tty for the password prompt). Otherwise the installer falls back to ~/.local/bin instead of dying on sudo: A terminal is required to authenticate.
  • An explicitly requested VOX_INSTALL_DIR never silently falls back: if it is not writable and sudo is unavailable, the installer fails with a clear error.
  • The binary is now chmod +x-ed before the move: the previous post-sudo mv chmod ran as the invoking user on a file that may no longer belong to them.
  • README documents the override and the fallback behavior.

Testing (Linux x86_64, no interactive sudo, piped cat install.sh | sh like real usage)

  1. VOX_INSTALL_DIR=<tmp>/bin → installed there, no sudo, binary runs (vox 0.15.0)
  2. Default dir, unwritable, no sudo → warns and falls back to $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)
  3. Explicit VOX_INSTALL_DIR=/usr/lib/voxtest (unwritable), no sudo → exits 1 with a clear error, no fallback

Not 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

…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>
@pszymkowiak
pszymkowiak merged commit c92366a into main Jul 9, 2026
6 of 8 checks passed
@pszymkowiak
pszymkowiak deleted the fix/install-dir-override branch July 9, 2026 17:42
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.

install.sh: support custom install dir instead of hardcoded /usr/local/bin (fails without interactive sudo)

1 participant