Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav K <prkrishn@hotmail.com>2014-02-02 05:32:55 +0400
committerPranav K <prkrishn@hotmail.com>2014-02-02 19:50:04 +0400
commit3ac3af1daf45bd40fee1a8741e9a53148c1a5d2e (patch)
tree5cdb2a6724725dc53e6ee4a2b7fdd9752f5631f3 /build.cmd
parent1964e884e19be1e7ab1eabbf7f47fb8bd09ccad4 (diff)
Cache nuget.exe in %LocalAppData% instead of downloading it everytime
Diffstat (limited to 'build.cmd')
-rw-r--r--build.cmd19
1 files changed, 13 insertions, 6 deletions
diff --git a/build.cmd b/build.cmd
index e2ce3f1317..ff2cbdb516 100644
--- a/build.cmd
+++ b/build.cmd
@@ -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 %*