forked from dotnet/docfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UpdateTemplate.cmd
46 lines (36 loc) · 853 Bytes
/
UpdateTemplate.cmd
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
@ECHO OFF
PUSHD %~dp0
SETLOCAL
SETLOCAL ENABLEDELAYEDEXPANSION
:: Check if node exists globally
WHERE node >NUL
IF NOT '%ERRORLEVEL%'=='0' (
ECHO ERROR: UpdateTemplate.cmd requires node installed globally.
GOTO :Exit
)
SET TemplateHome=%~dp0src\docfx.website.themes\
SET DefaultTemplate=%TemplateHome%default
CALL npm install -g gulp
CALL npm install -g bower
:: Check if gulp exists globally
WHERE gulp >NUL
IF NOT '%ERRORLEVEL%'=='0' (
ECHO ERROR: UpdateTemplate.cmd requires gulp installed globally.
GOTO :Exit
)
:: Check if bower exists globally
WHERE bower >NUL
IF NOT '%ERRORLEVEL%'=='0' (
ECHO ERROR: UpdateTemplate.cmd requires bower installed globally.
GOTO :Exit
)
CD %DefaultTemplate%
CALL npm install
CALL bower install
CALL gulp
CD %TemplateHome%
CALL npm install
CALL gulp
:Exit
POPD
EXIT /B %ERRORLEVEL%'