From 1a55425a9e1de60e41388816164adbd5bd002d54 Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Wed, 20 Nov 2024 17:26:56 -0500 Subject: [PATCH 1/2] Show command to path details on install failure Attempt to fix https://github.com/hackclub/high-seas/issues/823 --- public/scripts/hackatime-install.sh | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/public/scripts/hackatime-install.sh b/public/scripts/hackatime-install.sh index 7f73896a..2c528c98 100755 --- a/public/scripts/hackatime-install.sh +++ b/public/scripts/hackatime-install.sh @@ -39,20 +39,18 @@ configure_wakatime() { check_vscode() { log "Checking for VS Code installation..." if ! command -v code &>/dev/null; then - error "VS Code is not installed. Install it from https://code.visualstudio.com/Download" - if [ "$VERBOSE" = true ]; then - case "$OSTYPE" in - darwin*) - error "(In VS Code, press ⌘⇧P and type \"Shell Command: Install 'code' command in PATH\".)" - ;; - msys* | win32*) - error "(In VS Code, press Ctrl+Shift+P and type \"Shell Command: Install 'code' command in PATH\".)" - ;; - *) - error "(In VS Code, press Ctrl+Shift+P and type \"Shell Command: Install 'code' command in PATH\".)" - ;; - esac - fi + error "Couldn't detect VS Code! Install it from https://code.visualstudio.com/Download. If you already installed it, try this:" + case "$OSTYPE" in + darwin*) + error "(In VS Code, press ⌘⇧P and type \"Shell Command: Install 'code' command in PATH\".)" + ;; + msys* | win32*) + error "(In VS Code, press Ctrl+Shift+P and type \"Shell Command: Install 'code' command in PATH\".)" + ;; + *) + error "(In VS Code, press Ctrl+Shift+P and type \"Shell Command: Install 'code' command in PATH\".)" + ;; + esac exit 1 fi } From 7e401545356384e721f38a70efb581071da40fac Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Wed, 20 Nov 2024 17:28:55 -0500 Subject: [PATCH 2/2] Clarify to VSC 'press enter' --- public/scripts/hackatime-install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/scripts/hackatime-install.sh b/public/scripts/hackatime-install.sh index 2c528c98..6fc31715 100755 --- a/public/scripts/hackatime-install.sh +++ b/public/scripts/hackatime-install.sh @@ -42,15 +42,16 @@ check_vscode() { error "Couldn't detect VS Code! Install it from https://code.visualstudio.com/Download. If you already installed it, try this:" case "$OSTYPE" in darwin*) - error "(In VS Code, press ⌘⇧P and type \"Shell Command: Install 'code' command in PATH\".)" + error "(In VS Code, press ⌘⇧P and type \"Shell Command: Install 'code' command in PATH\". Then press 'Enter'.)" ;; msys* | win32*) - error "(In VS Code, press Ctrl+Shift+P and type \"Shell Command: Install 'code' command in PATH\".)" + error "(In VS Code, press Ctrl+Shift+P and type \"Shell Command: Install 'code' command in PATH\". Then press 'Enter'.)" ;; *) - error "(In VS Code, press Ctrl+Shift+P and type \"Shell Command: Install 'code' command in PATH\".)" + error "(In VS Code, press Ctrl+Shift+P and type \"Shell Command: Install 'code' command in PATH\". Then press 'Enter'.)" ;; esac + error "Once that's done, restart this script." exit 1 fi }