datasurvey/npmw.cmd

25 lines
460 B
Batchfile
Raw Permalink Normal View History

2021-07-03 21:48:27 +00:00
@echo off
@setlocal
set NPMW_DIR=%~dp0
if exist "%NPMW_DIR%\mvnw.cmd" (
set NPM_EXE=%NPMW_DIR%\target\node\npm.cmd
set INSTALL_NPM_COMMAND=%NPMW_DIR%\mvnw.cmd frontend:install-node-and-npm@install-node-and-npm
) else (
set NPM_EXE=%NPMW_DIR%\.gradle\npm\npm.cmd
set INSTALL_NPM_COMMAND=%NPMW_DIR%\gradlew.bat npmSetup
)
if not exist %NPM_EXE% (
call %INSTALL_NPM_COMMAND%
)
if not exist %NPM_EXE% goto globalNpm
%NPM_EXE% %*
:globalNpm
npm %*