Skip to content

Commit 34a3f5a

Browse files
committed
Show editor PATH hint regardless of detection and only offer all-editors option when multiple editors are found
- when only one editor is found, should not show 'all detected editors' option - show hint at all times
1 parent dee5591 commit 34a3f5a

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

‎install.ps1‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ Check-Editor "VSCodium" "codium"
3939
Check-Editor "Cursor" "cursor"
4040
Check-Editor "Antigravity" "agy-ide"
4141

42+
Write-Host "`nHint: If your editor is installed but not listed, you might need to add its command to your PATH." -ForegroundColor Yellow
43+
Write-Host "Open your editor, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P), and run a command like: `"Shell Command: Install 'cursor' command in PATH`" (or 'agy-ide', etc.)." -ForegroundColor Yellow
44+
4245
if ($availableEditors.Count -eq 0) {
43-
Write-Host "Hint: If your editor is installed, you might need to add its command to your PATH." -ForegroundColor Yellow
44-
Write-Host "Open your editor, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P), and run a command like: `"Shell Command: Install 'cursor' command in PATH`" (or 'agy-ide', etc.)." -ForegroundColor Yellow
4546
Write-Host "Error: No supported editors found in your PATH." -ForegroundColor Red
4647
Pause
4748
exit 1
@@ -51,7 +52,9 @@ Write-Host ""
5152
for ($i = 0; $i -lt $availableEditors.Count; $i++) {
5253
Write-Host "$($i + 1)) $($availableEditors[$i])"
5354
}
54-
Write-Host "a) All detected editors"
55+
if ($availableEditors.Count -gt 1) {
56+
Write-Host "a) All detected editors"
57+
}
5558
Write-Host "q) Quit`n"
5659

5760
$choice = Read-Host "Select where to install CWC to"
@@ -60,7 +63,13 @@ if ($choice -eq 'q' -or $choice -eq 'Q') {
6063
Write-Host "Installation cancelled."
6164
Pause
6265
exit 0
63-
} elseif ($choice -ne 'a' -and $choice -ne 'A') {
66+
} elseif ($choice -eq 'a' -or $choice -eq 'A') {
67+
if ($availableEditors.Count -le 1) {
68+
Write-Host "Error: Invalid choice. Exiting." -ForegroundColor Red
69+
Pause
70+
exit 1
71+
}
72+
} else {
6473
if ($choice -notmatch '^[0-9]+$' -or [int]$choice -lt 1 -or [int]$choice -gt $availableEditors.Count) {
6574
Write-Host "Error: Invalid choice. Exiting." -ForegroundColor Red
6675
Pause

‎install.sh‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,22 @@ check_editor "VSCodium" "codium"
6464
check_editor "Cursor" "cursor"
6565
check_editor "Antigravity" "agy-ide"
6666

67+
echo ""
68+
echo "Hint: If your editor is installed but not listed, you might need to add its command to your PATH."
69+
echo "Open your editor, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P), and run a command like: \"Shell Command: Install 'cursor' command in PATH\" (or 'agy-ide' etc.)."
70+
6771
if [ ${#AVAILABLE_EDITORS[@]} -eq 0 ]; then
6872
echo "Error: No supported editors found in your PATH."
69-
echo "Hint: If your editor is installed, you might need to add its command to your PATH."
70-
echo "Open your editor, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P), and run a command like: \"Shell Command: Install 'cursor' command in PATH\" (or 'agy-ide' etc.)."
7173
exit 1
7274
fi
7375

7476
echo ""
7577
for i in "${!AVAILABLE_EDITORS[@]}"; do
7678
echo "$((i+1))) ${AVAILABLE_EDITORS[$i]}"
7779
done
78-
echo "a) All detected editors"
80+
if [ ${#AVAILABLE_EDITORS[@]} -gt 1 ]; then
81+
echo "a) All detected editors"
82+
fi
7983
echo "q) Quit"
8084
echo ""
8185

@@ -89,7 +93,12 @@ fi
8993
if [[ "$choice" == "q" || "$choice" == "Q" ]]; then
9094
echo "Installation cancelled."
9195
exit 0
92-
elif [[ "$choice" != "a" && "$choice" != "A" ]]; then
96+
elif [[ "$choice" == "a" || "$choice" == "A" ]]; then
97+
if [ ${#AVAILABLE_EDITORS[@]} -le 1 ]; then
98+
echo "Invalid choice. Exiting."
99+
exit 1
100+
fi
101+
else
93102
if ! [[ "$choice" =~ ^[0-9]+$ ]] || [ "$choice" -lt 1 ] || [ "$choice" -gt "${#AVAILABLE_EDITORS[@]}" ]; then
94103
echo "Invalid choice. Exiting."
95104
exit 1

0 commit comments

Comments
 (0)