diff options
author | Pranav K <prkrishn@hotmail.com> | 2014-02-02 05:32:55 +0400 |
---|---|---|
committer | Pranav K <prkrishn@hotmail.com> | 2014-02-02 19:50:04 +0400 |
commit | 3ac3af1daf45bd40fee1a8741e9a53148c1a5d2e (patch) | |
tree | 5cdb2a6724725dc53e6ee4a2b7fdd9752f5631f3 /build.cmd | |
parent | 1964e884e19be1e7ab1eabbf7f47fb8bd09ccad4 (diff) |
Cache nuget.exe in %LocalAppData% instead of downloading it everytime
Diffstat (limited to 'build.cmd')
-rw-r--r-- | build.cmd | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -1,12 +1,19 @@ @echo off cd %~dp0 -IF EXIST .nuget\NuGet.exe goto part2 +SETLOCAL +SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe + +IF EXIST %CACHED_NUGET% goto copynuget echo Downloading latest version of NuGet.exe... -mkdir .nuget -@powershell -NoProfile -ExecutionPolicy unrestricted -Command "((new-object net.webclient).DownloadFile('https://nuget.org/nuget.exe', '.nuget\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 build +md .nuget +copy %CACHED_NUGET% .nuget\nuget.exe > nul -:part2 -set EnableNuGetPackageRestore=true -.nuget\NuGet.exe install Sake -version 0.2 -o packages +:build +.nuget\nuget.exe install Sake -version 0.2 -o packages packages\Sake.0.2\tools\Sake.exe -I build -f makefile.shade %* |