fix: 修复安装脚本静默退出并增强错误提示#107
Merged
Merged
Conversation
在 set -euo pipefail 下,tr /dev/urandom | head 会因 SIGPIPE 返回退出码 141, 导致首次安装时脚本在密码生成步骤静默终止,后续所有安装步骤均未执行。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
当 GitHub API 被限流或返回异常响应时,grep 匹配不到 tag_name 返回退出码 1, pipefail + set -e 导致脚本静默退出,无法显示 "获取最新版本失败" 的错误提示。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
之前 set -euo pipefail 导致任何未处理的错误都会静默退出, 用户完全看不到发生了什么。现在在 EXIT trap 中检测退出码, 异常退出时显示错误提示和日志路径。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
通过 ERR trap 捕获失败命令的详细信息,在 EXIT trap 中展示给用户, 方便定位问题。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
openleek
approved these changes
Mar 19, 2026
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.
Summary
set -euo pipefail下密码生成tr | head触发 SIGPIPE 导致首次安装静默退出Detect_Version中 API 限流时grep无匹配导致静默退出Detect_Target_Host中管道失败导致静默退出Test plan