feat: allow input to exit

This commit is contained in:
Patrick Erichsen 2025-03-12 17:21:27 -07:00
parent b1a93b7a2d
commit 18c5019524
2 changed files with 15 additions and 2 deletions

View file

@ -37,7 +37,15 @@ if (Test-Path ".nvmrc") {
if ($requiredVersion -ne $currentVersion) {
Write-Host "`n⚠️ Warning: Your Node.js version ($currentNodeVersion) does not match the required version ($requiredNodeVersion)" -ForegroundColor Yellow
Write-Host "Please consider switching to the correct version using: nvm use" -ForegroundColor Yellow
Write-Host "Continuing with installation anyway...`n" -ForegroundColor Yellow
# Check if running in interactive mode
if ([Environment]::UserInteractive -and [Environment]::GetCommandLineArgs().Count -eq 0) {
Write-Host "Press Enter to continue with installation anyway..." -NoNewline -ForegroundColor Yellow
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Write-Host "`n" # Add newline after key press
} else {
Write-Host "Continuing with installation anyway...`n" -ForegroundColor Yellow
}
}
}

View file

@ -17,7 +17,12 @@ if [ -f .nvmrc ]; then
if [ "$required_version" != "$current_version" ]; then
echo "⚠️ Warning: Your Node.js version ($current_node_version) does not match the required version ($required_node_version)"
echo "Please consider switching to the correct version using: nvm use"
echo "Continuing with installation anyway..."
if [ -t 0 ]; then
read -p "Press Enter to continue with installation anyway..."
else
echo "Continuing with installation anyway..."
fi
echo
fi
fi