Fix detection of npm folder

This commit is contained in:
Sebastiaan Janssen
2016-09-18 12:44:10 +02:00
parent 252a9015dc
commit 27f88dfb80
2 changed files with 40 additions and 32 deletions
+10 -6
View File
@@ -18,17 +18,20 @@ FOR /f "delims=" %%A in ('dir %nodeExtractFolder%\node* /b') DO SET "nodePath=%n
SET nuGetFolder=%CD%\..\packages\
FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\"
IF %npmPath% == [] (
IF [%npmPath%] == [] GOTO :installnpm
IF NOT [%npmPath%] == [] GOTO :build
:installnpm
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%
FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\"
GOTO :build
:build
PATH=%npmPath%;%nodePath%
SET buildFolder=%CD%
ECHO Change directory to %CD%\..\OurUmbraco.Client\
@@ -38,8 +41,9 @@ ECHO Do npm install and the gulp build
SET npm="%nodePath%\node.exe" "%npmPath%node_modules\npm\bin\npm-cli.js" %*
%npm% cache clean
%npm% install
%npm% install -g install gulp -g --quiet
%npm% install -g install gulp -g
gulp build
ECHO Move back to the build folder
CD %buildFolder%
GOTO :EOF
+10 -6
View File
@@ -18,17 +18,20 @@ FOR /f "delims=" %%A in ('dir %nodeExtractFolder%\node* /b') DO SET "nodePath=%n
SET nuGetFolder=%CD%\..\packages\
FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\"
IF %npmPath% == [] (
IF [%npmPath%] == [] GOTO :installnpm
IF NOT [%npmPath%] == [] GOTO :build
:installnpm
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%
FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\"
GOTO :build
:build
PATH=%npmPath%;%nodePath%
SET buildFolder=%CD%
ECHO Change directory to %CD%\..\OurUmbraco.Client\
@@ -38,8 +41,9 @@ ECHO Do npm install and the gulp build
SET npm="%nodePath%\node.exe" "%npmPath%node_modules\npm\bin\npm-cli.js" %*
%npm% cache clean
%npm% install
%npm% install -g install gulp -g --quiet
%npm% install -g install gulp -g
gulp
ECHO Move back to the build folder
CD %buildFolder%
GOTO :EOF