Skip to content

Commit 508f223

Browse files
committed
Add Pause commands before script exits to keep console open
- in powershell when there is not git, the window immediately closes making the information unable to read ├── install.ps1 └── install.sh
1 parent dc49d7c commit 508f223

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎install.ps1‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@ $ErrorActionPreference = "Stop"
33
# Check git first
44
if (!(Get-Command git -ErrorAction SilentlyContinue)) {
55
Write-Host "Error: git is required but not installed." -ForegroundColor Red
6+
Pause
67
exit 1
78
}
89

910
# Validate Node.js version
1011
if (!(Get-Command node -ErrorAction SilentlyContinue)) {
1112
Write-Host "Error: Node.js version 20 or higher is required." -ForegroundColor Red
13+
Pause
1214
exit 1
1315
}
1416

1517
$nodeVersion = (node -v) -replace '^v',''
1618
$major = [int]($nodeVersion -split '\.')[0]
1719
if ($major -lt 20) {
1820
Write-Host "Error: Node.js version 20 or higher is required (Node.js 22.x is recommended)." -ForegroundColor Red
21+
Pause
1922
exit 1
2023
}
2124

@@ -40,6 +43,7 @@ if ($availableEditors.Count -eq 0) {
4043
Write-Host "Hint: If your editor is installed, you might need to add its command to your PATH." -ForegroundColor Yellow
4144
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
4245
Write-Host "Error: No supported editors found in your PATH." -ForegroundColor Red
46+
Pause
4347
exit 1
4448
}
4549

@@ -54,10 +58,12 @@ $choice = Read-Host "Select editor(s) to install CWC to"
5458

5559
if ($choice -eq 'q' -or $choice -eq 'Q') {
5660
Write-Host "Installation cancelled."
61+
Pause
5762
exit 0
5863
} elseif ($choice -ne 'a' -and $choice -ne 'A') {
5964
if ($choice -notmatch '^[0-9]+$' -or [int]$choice -lt 1 -or [int]$choice -gt $availableEditors.Count) {
6065
Write-Host "Error: Invalid choice. Exiting." -ForegroundColor Red
66+
Pause
6167
exit 1
6268
}
6369
}
@@ -81,6 +87,7 @@ $vsixFile = Get-ChildItem *.vsix | Select-Object -First 1
8187
if (!$vsixFile) {
8288
Write-Host "Error: VSIX file was not generated." -ForegroundColor Red
8389
Pop-Location
90+
Pause
8491
exit 1
8592
}
8693

@@ -101,6 +108,7 @@ if ($choice -eq 'a' -or $choice -eq 'A') {
101108

102109
Write-Host "`nDone!"
103110

111+
Pause
104112
Pop-Location
105113
# Run cleanup in the background to avoid sluggish exit
106114
Start-Process -FilePath "cmd.exe" -ArgumentList "/c", "rmdir", "/s", "/q", "`"$tmpDir`"" -WindowStyle Hidden

0 commit comments

Comments
 (0)