From 42ccb6b1c0fdf1c9d09fa21d0c93cbe70401a974 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 3 Sep 2017 21:48:00 -0700 Subject: [PATCH] Fix typo in build.ps1 and use nuget.config (#1420) * Fix typo in build.ps1 * Use nuget.config package sources in build.ps1 Installing a package within build.ps1 ignored the Src\nuget.config file, leading to failures depending on the machine configuration. With this change, the script will successfully install the package it needs independent of machine configuration. * Reuse existing variable to simplify script --- Build/build.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index 57cb05a3..a6115d7e 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -70,8 +70,8 @@ task Build -depends Clean { mkdir "$buildDir\Temp" -Force EnsureNuGetExists - EnsureNuGetPacakge "vswhere" $vswherePath $vswhereVersion - EnsureNuGetPacakge "NUnit.ConsoleRunner" $nunitConsolePath $nunitConsoleVersion + EnsureNuGetPackage "vswhere" $vswherePath $vswhereVersion + EnsureNuGetPackage "NUnit.ConsoleRunner" $nunitConsolePath $nunitConsoleVersion $script:msBuildPath = GetMsBuildPath Write-Host "MSBuild path $script:msBuildPath" @@ -193,12 +193,12 @@ function EnsureNuGetExists() } } -function EnsureNuGetPacakge($packageName, $packagePath, $packageVersion) +function EnsureNuGetPackage($packageName, $packagePath, $packageVersion) { if (!(Test-Path $packagePath)) { Write-Host "Couldn't find $packagePath. Downloading with NuGet" - exec { & $nugetPath install $packageName -OutputDirectory $buildDir\Temp -Version $packageVersion | Out-Default } "Error restoring $packagePath" + exec { & $nugetPath install $packageName -OutputDirectory $buildDir\Temp -Version $packageVersion -ConfigFile "$sourceDir\nuget.config" | Out-Default } "Error restoring $packagePath" } }