mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-22 19:41:08 +07:00
Minor fixes
This commit is contained in:
parent
5d1a72cb19
commit
a841c568fd
@ -8,7 +8,7 @@ Write-Host "Found '$dotnet'"
|
|||||||
|
|
||||||
$version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() }
|
$version = & $dotnet --version | Out-String | ForEach-Object { $_.Trim() }
|
||||||
Write-Host "Version $version"
|
Write-Host "Version $version"
|
||||||
if ($version -notmatch $args[0])
|
if (-not ($version.StartsWith($args[0])))
|
||||||
{
|
{
|
||||||
Write-Host "PATH='$env:PATH'"
|
Write-Host "PATH='$env:PATH'"
|
||||||
throw "Unexpected version"
|
throw "Unexpected version"
|
||||||
@ -20,8 +20,10 @@ if ($args[1])
|
|||||||
$versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() }
|
$versions = & $dotnet --list-sdks | ForEach-Object { $_.SubString(0, $_.IndexOf('[')).Trim() }
|
||||||
Write-Host "Installed versions: $versions"
|
Write-Host "Installed versions: $versions"
|
||||||
$isInstalledVersion = $false
|
$isInstalledVersion = $false
|
||||||
foreach ($version in $versions) {
|
foreach ($version in $versions)
|
||||||
if ($version.StartsWith($args[1].ToString())) {
|
{
|
||||||
|
if ($version.StartsWith($args[1].ToString()))
|
||||||
|
{
|
||||||
$isInstalledVersion = $true
|
$isInstalledVersion = $true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user