Skip to content

Commit 53be4b5

Browse files
committed
fix: Correct binary verification message and improve download error handling in install.sh
- Fixed a character encoding issue in the binary verification message to ensure proper display. - Updated the curl command to use a progress bar instead of verbose output, enhancing user experience during downloads. - Improved the error message for failed binary downloads to include HTTP status information for better debugging. These changes enhance the reliability and clarity of the installation script, providing users with more accurate feedback during the installation process.
1 parent e46a7ec commit 53be4b5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

install.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ check_requirements() {
7676

7777
# Verify binary / 验证二进制文件
7878
verify_binary() {
79-
info "Verifying binary..." "正在验证二进制文件..."
79+
info "Verifying binary..." "正在验证二���制文件..."
8080
if [ ! -f "$TEMP_DIR/$BINARY_NAME" ]; then
8181
error "Binary file download failed or does not exist" \
8282
"二进制文件下载失败或不存在"
@@ -126,11 +126,10 @@ main() {
126126
DOWNLOAD_URL="https://github.com/yuaotian/go-cursor-help/raw/refs/heads/master/bin/$BINARY_NAME"
127127

128128
# 使用 curl 显示详细的下载进度信息
129-
if ! curl -L --progress --show-error \
130-
--write-out "\n" \
131-
"$DOWNLOAD_URL" -o "$TEMP_DIR/$BINARY_NAME"; then
132-
error "Failed to download binary from: $DOWNLOAD_URL" \
133-
"从以下地址下载二进制文件失败:$DOWNLOAD_URL"
129+
if ! curl -L --progress-bar \
130+
"$DOWNLOAD_URL" -o "$TEMP_DIR/$BINARY_NAME" 2>/dev/null; then
131+
error "Failed to download binary from: $DOWNLOAD_URL (HTTP Status: $?)" \
132+
"从以下地址下载二进制文件失败:$DOWNLOAD_URL (HTTP状态码: $?)"
134133
fi
135134

136135
# Verify download / 验证下载

0 commit comments

Comments
 (0)