[Windows] postdotnet: delete nuget.conf if exists (#4013)

* postdotnet: delete nuget.conf if exists

* rename to $nugetConfigPath

* add nuget.config check test

* remove issue link
This commit is contained in:
Aleksandr Chebotov
2021-09-03 14:02:30 +03:00
committed by GitHub
parent aa3d80baa9
commit d261844fc2
2 changed files with 4 additions and 4 deletions

View File

@@ -7,8 +7,5 @@ if (-not $latestPath.Contains($dotnetPath))
[System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine)
}
# Delete empty nuget.config file created by choco and recreate the config using the 'dotnet nuget list source command'
# before choco or powershells ancient embedded nuget does to prevent the issue with downloading packages from nuget.org
# https://github.com/actions/virtual-environments/issues/3038
Remove-Item $env:APPDATA\NuGet\NuGet.Config -Force
# Recreate the config using the 'dotnet nuget list source command'
dotnet nuget list source

View File

@@ -44,6 +44,9 @@ Describe "Nuget" {
It "Nuget" {
"nuget" | Should -ReturnZeroExitCode
}
It "NuGet.Config not exists" {
"$env:APPDATA\NuGet\NuGet.Config" | Should -Not -Exist
}
}
Describe "OpenSSL" {