mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-22 19:41:08 +07:00
Minor fix
This commit is contained in:
parent
92451e3d46
commit
ac1baccba4
@ -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 (-not ($version.StartsWith($args[0])))
|
if (-not ($version.StartsWith($args[0].ToString()))
|
||||||
{
|
{
|
||||||
Write-Host "PATH='$env:PATH'"
|
Write-Host "PATH='$env:PATH'"
|
||||||
throw "Unexpected version"
|
throw "Unexpected version"
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
if [ -z "$1" ]; then
|
|
||||||
echo "Must supply dotnet version argument"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
dotnet_version="$(dotnet --version)"
|
|
||||||
echo "Found dotnet version '$dotnet_version'"
|
|
||||||
if [ -z "$(echo $dotnet_version | grep $1)" ]; then
|
|
||||||
echo "Unexpected version"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$2" ]; then
|
|
||||||
dotnet_version="$(dotnet --list-sdks)"
|
|
||||||
echo "Found dotnet version '$dotnet_version'"
|
|
||||||
if [ -z "$(echo $dotnet_version | grep $2)" ]; then
|
|
||||||
echo "Unexpected version"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Building sample csproj"
|
|
||||||
dotnet build __tests__/sample-csproj/ --no-cache || exit 1
|
|
||||||
|
|
||||||
echo "Testing compiled app"
|
|
||||||
sample_output=$(dotnet test __tests__/sample-csproj/ --no-build)
|
|
||||||
echo "Sample output: $sample_output"
|
|
||||||
# For Side-by-Side installs we want to run the tests twice, for a single install the tests will run once
|
|
||||||
if [ -n "$2" ]; then
|
|
||||||
if [ -z "$(echo $sample_output | grep "Test Run Successful.*Test Run Successful.")" ]; then
|
|
||||||
echo "Unexpected output"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [ -z "$(echo $sample_output | grep "Test Run Successful.")" ]; then
|
|
||||||
echo "Unexpected output"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
Loading…
Reference in New Issue
Block a user