From 252a9015dc00f9cfdccfbc535db7191182a72e2b Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Sun, 18 Sep 2016 12:20:42 +0200 Subject: [PATCH] Detect if npm is already there and don't download it again --- build/RunGulp.bat | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build/RunGulp.bat b/build/RunGulp.bat index 8f47a8ed..7b199563 100644 --- a/build/RunGulp.bat +++ b/build/RunGulp.bat @@ -17,10 +17,14 @@ IF NOT EXIST %nodeExtractFolder% ( FOR /f "delims=" %%A in ('dir %nodeExtractFolder%\node* /b') DO SET "nodePath=%nodeExtractFolder%\%%A" SET nuGetFolder=%CD%\..\packages\ -ECHO Configured packages folder: %nuGetFolder% -ECHO Installing Npm NuGet Package -%CD%\..\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\" +IF %npmPath% == [] ( + ECHO Downloading npm + ECHO Configured packages folder: %nuGetFolder% + ECHO Installing Npm NuGet Package + %CD%\..\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet + FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\" +) REM Ensures that we look for the just downloaded NPM, not whatever the user has installed on their machine PATH=%npmPath%;%nodePath%