From 0d242b3aa8fb6ee34b209872731e4136f42e7cf5 Mon Sep 17 00:00:00 2001 From: Lachlan Donald Date: Sun, 5 Oct 2025 20:55:13 +1100 Subject: [PATCH] fix: handle unavailable VSCode extensions gracefully MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make VSCode extension installer more resilient by continuing on failures instead of stopping. Also remove yokawasa.jwt-debugger which is not available on some platforms. Changes: - Remove yokawasa.jwt-debugger from extensions list (unavailable) - Install extensions one-by-one with proper error handling - Capture output and check exit code separately (avoids pipefail issues) - Show ✓ for successful installs, ✗ for failures with reason - Continue installation even if some extensions fail --- vscode/extensions.txt | 1 - vscode/install.sh | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/vscode/extensions.txt b/vscode/extensions.txt index 8b89937..1b7116b 100644 --- a/vscode/extensions.txt +++ b/vscode/extensions.txt @@ -28,5 +28,4 @@ sourcegraph.amp tamasfe.even-better-toml timonwong.shellcheck vscodevim.vim -yokawasa.jwt-debugger ziglang.vscode-zig diff --git a/vscode/install.sh b/vscode/install.sh index a18d0f8..5f2b4ab 100755 --- a/vscode/install.sh +++ b/vscode/install.sh @@ -24,9 +24,21 @@ if [ -f "$EXTENSIONS_FILE" ]; then while IFS= read -r line; do echo " $line" done <<< "$EXTENSIONS_TO_INSTALL" - # Pass only the missing extensions to the install command - xargs -L 1 code --install-extension <<< "$EXTENSIONS_TO_INSTALL" - echo " Missing extension installation complete." + # Install extensions one by one, continuing on failures + while IFS= read -r ext; do + # Capture output and exit code separately to avoid pipefail issues + if output=$(code --install-extension "$ext" 2>&1); then + echo " ✓ $ext" + else + # Check if it's a "not found" error or other failure + if echo "$output" | grep -q "not found"; then + echo " ✗ $ext (not found)" + else + echo " ✗ $ext (failed: ${output%%$'\n'*})" + fi + fi + done <<< "$EXTENSIONS_TO_INSTALL" + echo " Extension installation complete." else echo " All specified extensions are already installed." fi