Repository navigation
fix(cli): update replaces an ash in a read-only bin dir in place - #7
Merged
Merged
Conversation
When `ash` lived in a directory the user can't write (root-owned /usr/local/bin holding a user-owned ash, no passwordless sudo), install and `ash update` wrote a second copy to ~/.local/bin and left the old one first on PATH, so non-interactive shells kept running the stale CLI. - if the directory isn't writable but the ash file is, overwrite it in place - after installing elsewhere, warn when an earlier ash on PATH still shadows it - `ash update` exits right after the rewrite so bash doesn't keep reading the file it just replaced Found on a machine where the pre-rewrite CLI (no `update` command) sat in /usr/local/bin while the new one had been installed into ~/.local/bin. Co-Authored-By: Claude Opus 5.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.
问题
ash所在目录不可写(root 建的/usr/local/bin里放着本人的 ash、又没有免密 sudo)时,安装和ash update会在~/.local/bin另装一份,PATH 里更靠前的旧版本永远不会被替换,非交互 shell(ssh 命令、部分 Agent 工具)一直在跑旧 CLI。实际在 100.70.70.3 上遇到:/usr/local/bin里是重写前的老 CLI(没有update命令,只打印帮助),新 CLI 装在了~/.local/bin。修复
ash update改写完立即退出,bash 不会接着读被改写的脚本测试
npm run check:UI 29、server 58 全部通过🤖 Generated with Claude Code