-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: check for nvm
version in install script
#4621
Conversation
✅ Deploy Preview for continuedev canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good idea to me
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..." | ||
echo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could easily scroll off, maybe something like:
if [ -t 0 ] ; then
read "Hit return to continue "
else
echo "Continuing with installation anyway..."
fi
No idea how to do that in Powershell...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure either but this was what 3.5 Sonnet generated 🤷
if (Test-Path ".nvmrc") {
$requiredNodeVersion = Get-Content ".nvmrc"
$currentNodeVersion = node -v
# Remove 'v' prefix from versions for comparison
$requiredVersion = $requiredNodeVersion.TrimStart('v')
$currentVersion = $currentNodeVersion.TrimStart('v')
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
# 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
}
}
}
Our CI will at least catch if there are any issues with the install script in a non-interactive mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add arch detection for nodejs?
No description provided.