Skip to content

Commit

Permalink
Prefer nuget.exe from PATH if available
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Nov 8, 2018
1 parent 11e1856 commit 8113907
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Build/PreBuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ $outdir = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPat
pushd "$buildroot\Build"
try {
$arglist = "restore", "$vstarget\packages.config", "-OutputDirectory", $outdir, "-Config", "$vstarget\nuget.config", "-NonInteractive"
Start-Process -Wait -NoNewWindow .\nuget.exe -ErrorAction Stop -ArgumentList $arglist
$nuget = gcm nuget.exe -EA 0
if (-not $nuget) {
$nuget = gcm .\nuget.exe
}
Start-Process -Wait -NoNewWindow $nuget.Source -ErrorAction Stop -ArgumentList $arglist

$versions = @{}
([xml](gc "$vstarget\packages.config")).packages.package | %{ $versions[$_.id] = $_.version }
Expand Down

0 comments on commit 8113907

Please sign in to comment.