mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-27 03:46:23 +08:00
Ignore last exit code in the build step as dotnet
may return error when SDK is not installed (#11972)
This commit is contained in:
parent
c97f2d7fd7
commit
91c9be996a
@ -342,7 +342,7 @@ function Start-PSBuild {
|
||||
}
|
||||
|
||||
# Verify if the dotnet in-use is the required version
|
||||
$dotnetCLIInstalledVersion = (dotnet --version)
|
||||
$dotnetCLIInstalledVersion = Start-NativeExecution -sb { dotnet --version } -IgnoreExitcode
|
||||
If ($dotnetCLIInstalledVersion -ne $dotnetCLIRequiredVersion) {
|
||||
Write-Warning @"
|
||||
The currently installed .NET Command Line Tools is not the required version.
|
||||
@ -1837,7 +1837,7 @@ function Start-PSBootstrap {
|
||||
$dotNetExists = precheck 'dotnet' $null
|
||||
$dotNetVersion = [string]::Empty
|
||||
if($dotNetExists) {
|
||||
$dotNetVersion = (dotnet --version)
|
||||
$dotNetVersion = Start-NativeExecution -sb { dotnet --version } -IgnoreExitcode
|
||||
}
|
||||
|
||||
if(!$dotNetExists -or $dotNetVersion -ne $dotnetCLIRequiredVersion -or $Force.IsPresent) {
|
||||
@ -2017,7 +2017,7 @@ function Find-Dotnet() {
|
||||
if (precheck dotnet) {
|
||||
# Must run from within repo to ensure global.json can specify the required SDK version
|
||||
Push-Location $PSScriptRoot
|
||||
$dotnetCLIInstalledVersion = (dotnet --version)
|
||||
$dotnetCLIInstalledVersion = Start-NativeExecution -sb { dotnet --version } -IgnoreExitcode
|
||||
Pop-Location
|
||||
if ($dotnetCLIInstalledVersion -ne $dotnetCLIRequiredVersion) {
|
||||
Write-Warning "The 'dotnet' in the current path can't find SDK version ${dotnetCLIRequiredVersion}, prepending $dotnetPath to PATH."
|
||||
|
Loading…
Reference in New Issue
Block a user