Browse Source

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.
pull/20/head
Xx 6 months ago
parent
commit
53be4b55fd
  1. 11
      install.sh

11
install.sh

@ -76,7 +76,7 @@ check_requirements() {
# Verify binary / 验证二进制文件 # Verify binary / 验证二进制文件
verify_binary() { verify_binary() {
info "Verifying binary..." "正在验证二制文件..."
info "Verifying binary..." "正在验证二���制文件..."
if [ ! -f "$TEMP_DIR/$BINARY_NAME" ]; then if [ ! -f "$TEMP_DIR/$BINARY_NAME" ]; then
error "Binary file download failed or does not exist" \ error "Binary file download failed or does not exist" \
"二进制文件下载失败或不存在" "二进制文件下载失败或不存在"
@ -126,11 +126,10 @@ main() {
DOWNLOAD_URL="https://github.com/yuaotian/go-cursor-help/raw/refs/heads/master/bin/$BINARY_NAME" DOWNLOAD_URL="https://github.com/yuaotian/go-cursor-help/raw/refs/heads/master/bin/$BINARY_NAME"
# 使用 curl 显示详细的下载进度信息 # 使用 curl 显示详细的下载进度信息
if ! curl -L --progress --show-error \
--write-out "\n" \
"$DOWNLOAD_URL" -o "$TEMP_DIR/$BINARY_NAME"; then
error "Failed to download binary from: $DOWNLOAD_URL" \
"从以下地址下载二进制文件失败:$DOWNLOAD_URL"
if ! curl -L --progress-bar \
"$DOWNLOAD_URL" -o "$TEMP_DIR/$BINARY_NAME" 2>/dev/null; then
error "Failed to download binary from: $DOWNLOAD_URL (HTTP Status: $?)" \
"从以下地址下载二进制文件失败:$DOWNLOAD_URL (HTTP状态码: $?)"
fi fi
# Verify download / 验证下载 # Verify download / 验证下载

Loading…
Cancel
Save