-
Notifications
You must be signed in to change notification settings - Fork 172
/
gulpme.bat
82 lines (69 loc) · 1.8 KB
/
gulpme.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@echo off
rem set the directory to the same value as tht used to strt the bat file
setlocal enabledelayedexpansion
@setlocal enableextensions
@cd /d "%~dp0"
set NODE_MODULES_PATH=%~dp0%node_modules
set NULL_VAL=null
set NODE_VER=%NULL_VAL%
set NODE_EXEC=v22.3.0/node-v22.3.0-x86.msi
node -v >.tmp_nodever
set /p NODE_VER=<.tmp_nodever
del .tmp_nodever
set GULP_PATH=%NULL_VAL%
where gulp > .tempGulpPath
set /p GULP_PATH=<.tempGulpPath
del .tempGulpPath
IF "%NODE_VER%"=="%NULL_VAL%" (
NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
echo This setup needs admin permissions. Please run this file as admin.
pause
exit
)
echo.
echo Node.js is not installed! Please press a key to download and install it from the website that will open.
PAUSE
start "" http://nodejs.org/dist/%NODE_EXEC%
echo.
echo.
echo After you have installed Node.js, press a key to shut down this process. Please restart it again afterwards.
call npm install
PAUSE
EXIT
) ELSE (
echo A version of Node.js ^(%NODE_VER%^) is installed. Proceeding...
)
set InstallGulp=0
if "%GULP_PATH%"=="%NULL_VAL%" (
set InstallGulp=1
echo no gulp path
)
if NOT exist %NODE_MODULES_PATH% (
set InstallGulp=1
echo no modules dir
)
rem echo NODE_MODULES_PATH = %NODE_MODULES_PATH%
rem echo GULP_PATH = %GULP_PATH%
rem echo InstallGulp = !InstallGulp!
rem pause
IF !InstallGulp! == 1 (
NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
echo This setup needs admin permissions. Please run this file as admin.
pause
exit
)
echo.
echo Install gulp
call npm install
call npm install --global gulp-cli
call npm install --global
call npm install --save-dev gulp
call npm audit fix
) ELSE (
echo gulp is installed. Proceeding...
)
echo execute gulp
gulp
pause