From 260eb8283de06f96ef681a9dd3295f5a8d86f2e7 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Wed, 1 Oct 2025 22:44:13 +0800 Subject: [PATCH] fix: Improve error handling and diagnostics in install-remote.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enhanced the extract_repository function to properly capture and display unzip error messages, helping diagnose extraction failures during remote installation. Changes: - Capture unzip output in variable for better error reporting - Display detailed error messages when extraction fails - Improve ZIP integrity test error handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- install-remote.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install-remote.sh b/install-remote.sh index ecce7ece..a153c3c0 100644 --- a/install-remote.sh +++ b/install-remote.sh @@ -138,7 +138,8 @@ function extract_repository() { fi # Try to extract - if unzip -q "$zip_path" -d "$temp_dir" 2>&1; then + local unzip_output + if unzip_output=$(unzip -q "$zip_path" -d "$temp_dir" 2>&1); then # Find the extracted directory (usually repo-name-branch) local repo_dir repo_dir=$(find "$temp_dir" -maxdepth 1 -type d -name "Claude-Code-Workflow-*" | head -n 1) @@ -155,8 +156,13 @@ function extract_repository() { fi else write_color "Extraction failed" "$COLOR_ERROR" + if [ -n "$unzip_output" ]; then + write_color "Error details: $unzip_output" "$COLOR_ERROR" + fi write_color "Testing zip file integrity..." "$COLOR_INFO" - unzip -t "$zip_path" + if ! unzip -t "$zip_path" 2>&1; then + write_color "ZIP file is corrupted" "$COLOR_ERROR" + fi return 1 fi }