Skip to content

Commit

Permalink
Fix node version detect logic to handle node v10 (PowerShell#2025)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkeithhill authored and rjmholt committed Jul 24, 2019
1 parent dad582d commit 794a66c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ function needsVSCode () {

function needsNodeJS () {
try {
$nodeJSVersion = (node -v)

$nodeJSVersion = node -v
} catch {
return $true
}
return ($nodeJSVersion.Substring(1,1) -lt 6)

if ($nodeJSVersion -notmatch 'v(\d+\.\d+\.\d+)') {
return $true
}

$nodeVer = [System.Version]$matches[1]
return ($nodeVer.Major -lt 6)
}

function needsPowerShellGet () {
Expand Down

0 comments on commit 794a66c

Please sign in to comment.