Skip to content

get.sh: warn about other onctl copies on PATH after installing - #1213

Merged
cdalar merged 1 commit into
mainfrom
get-sh-warn-other-copies
Oct 22, 2026
Merged

cdalar merged 1 commit into
mainfrom
get-sh-warn-other-copies

Conversation

@cdalar

@cdalar cdalar commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Why

Running the edge installer printed "Installed ... v0.1.36" but onctl version kept reporting v0.1.35. An older copy lived in /usr/local/bin, and the interactive bash had already hashed that path before the install, so the new binary in ~/.local/bin was never picked up.

Putting hash -r in the script does nothing: curl | bash runs it as a child process, so it cannot touch the parent shell's hash table.

What

After installing, get.sh scans PATH for any other onctl that is not the one just installed (-ef, so symlinked dirs don't false-positive). If it finds any, it prints them and tells the user to remove them or run hash -r.

Output on a machine with a stale copy:

Note: other onctl binaries are on your PATH and may run instead of this one:
    /usr/local/bin/onctl
Remove them, or run 'hash -r' so your shell stops using a cached path.

Silent when there is nothing to report. Tested under set -euo pipefail both ways.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SB788HixFrKbYGCxDRi8fX

A stale copy elsewhere on PATH (an old /usr/local/bin install, a
`go install` in ~/go/bin) can still be the one that runs after a fresh
install: its directory may come first, or the user's shell has already
hashed it. The installer runs as a child process so it cannot clear
that hash itself; instead it now lists the other copies and tells the
user to remove them or run `hash -r`.

Claude-Session: https://claude.ai/code/session_01SB788HixFrKbYGCxDRi8fX
@cdalar
cdalar enabled auto-merge October 22, 2026 04:27
@cdalar
cdalar merged commit ae72d05 into main Oct 22, 2026
14 checks passed
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.22%. Comparing base (55ef6be) to head (4980e59).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1213   +/-   ##
=======================================
  Coverage   45.22%   45.22%           
=======================================
  Files          75       75           
  Lines        8732     8732           
=======================================
  Hits         3949     3949           
  Misses       4782     4782           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 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.

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.

1 participant

⌂ 换网址