Skip to content

Install CLI to ~/.local/bin without sudo#379

Merged
theFong merged 3 commits intomainfrom
install-without-sudo
May 5, 2026
Merged

Install CLI to ~/.local/bin without sudo#379
theFong merged 3 commits intomainfrom
install-without-sudo

Conversation

@theFong
Copy link
Copy Markdown
Member

@theFong theFong commented May 4, 2026

Summary

  • Install scripts (bin/install-latest.sh, bin/install-latest-linux.sh) now drop the binary into ~/.local/bin with no sudo, creating the directory if needed and warning when it's not on PATH.
  • README updated: removed sudo from the Linux/WSL install commands, switched to the curl ... | bash form, and added a short note pointing users at ~/.local/bin and the PATH line to add if missing.

Test plan

  • Run bash bin/install-latest.sh on macOS with ~/.local/bin already on PATH — confirm install succeeds with no warning.
  • Run bash bin/install-latest.sh on a fresh Linux box without ~/.local/bin on PATH — confirm the warning prints with the suggested export line.
  • Verify the README install command runs end-to-end via curl ... | bash.

Drop the sudo-to-/usr/local/bin install path in favor of a userland
install at ~/.local/bin. The installer creates the dir, drops the
binary, and warns if ~/.local/bin isn't on PATH. README updated to
match and to use the curl | bash form.
@theFong theFong requested a review from a team as a code owner May 4, 2026 02:32
@theFong
Copy link
Copy Markdown
Member Author

theFong commented May 4, 2026

Tested

macOS (arm64, host)

  • bash bin/install-latest.sh → installed ~/.local/bin/brev (v0.6.323), Mach-O arm64.
  • ~/.local/bin was already on PATH → no warning printed (correct).
  • brev --version runs.

Ubuntu 22.04 (Docker, fresh container)

  • Test 1 — fresh PATH (no ~/.local/bin): installer placed binary at /root/.local/bin/brev and printed:
    Warning: /root/.local/bin is not in your PATH.
    Add it by appending the following line to your shell profile (e.g. ~/.bashrc, ~/.zshrc):
        export PATH="${HOME}/.local/bin:${PATH}"
    Then restart your shell or run 'source' on the profile to pick up the change.
    
  • ~/.local/bin/brev --versionCurrent Version: v0.6.323.
  • Test 2 — re-ran with ~/.local/bin prepended to PATH: no warning printed (correct), which brev resolves to /root/.local/bin/brev.

patelspratik
patelspratik previously approved these changes May 4, 2026
@patelspratik
Copy link
Copy Markdown
Contributor

patelspratik commented May 4, 2026

brev upgrade text needs to be altered to match that sudo is no longer required

brev upgrade also needs to be made aware as the upgrade will install to the new location

Address PR review feedback: the install script writes to ~/.local/bin
without sudo, so brev upgrade no longer gates on sudo and the prompt
text reflects the new location. After a direct upgrade we also detect
when the running binary lives in /usr/local/bin or /usr/bin (left over
from a pre-~/.local/bin install) and tell the user to remove it so
PATH resolution doesn't keep pinning them to the old version.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 28.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.85%. Comparing base (9e0e34b) to head (f0a2ac5).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cmd/upgrade/upgrade.go 28.00% 14 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #379      +/-   ##
==========================================
+ Coverage   18.18%   18.85%   +0.66%     
==========================================
  Files         140      140              
  Lines       18684    18206     -478     
==========================================
+ Hits         3398     3433      +35     
+ Misses      14912    14390     -522     
- Partials      374      383       +9     
Flag Coverage Δ
Linux 18.85% <28.00%> (+0.66%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@theFong theFong merged commit aa0799e into main May 5, 2026
11 checks passed
@theFong theFong deleted the install-without-sudo branch May 5, 2026 00:37
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.

2 participants