From 12fa69c7bc8dd3ce219aa3b60a125337b4c882a1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sun, 2 Feb 2014 08:18:43 -0800 Subject: [PATCH] Updating build.cmd to cache NuGet.exe --- build.cmd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build.cmd b/build.cmd index d54931bc8f..7045ee1f84 100644 --- a/build.cmd +++ b/build.cmd @@ -1,10 +1,18 @@ @echo off cd %~dp0 -IF EXIST .nuget\NuGet.exe goto restore +SETLOCAL +SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe + +IF EXIST %CACHED_NUGET% goto copynuget echo Downloading latest version of NuGet.exe... +IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet +@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'" + +:copynuget +IF EXIST .nuget\nuget.exe goto restore md .nuget -@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '.nuget\NuGet.exe'" +copy %CACHED_NUGET% .nuget\nuget.exe > nul :restore IF EXIST packages\KoreBuild goto run