-
Notifications
You must be signed in to change notification settings - Fork 202
/
make.bat
74 lines (62 loc) · 1.38 KB
/
make.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
@echo off
if ["%~1"] == [""] (
goto :help
)
if "%~1" == "serve" (
goto :serve
)
if "%~1" == "test" (
goto :test
)
if "%~1" == "publish" (
goto :publish
)
if "%~1" == "lint" (
goto :lint
)
if "%~1" == "clean" (
goto :clean
)
:help
echo Usage:
echo make.bat [options]
echo.
echo Options:
echo serve Start the Python webserver
echo test Start the test Python webserver
echo publish Publish the website via Github pages
echo lint Run Prettier
echo clean Remove docs and wasm html pages
exit /b 0
:serve
call :clean
call node generate.js lessons docs beta
call node generate.js wasm docs\webassembly beta
call cd docs && python -m http.server 8080
exit /b 0
:test
call :clean
call node generate.js lessons docs
call node generate.js wasm docs\webassembly
call cd docs && python -m http.server 8080
exit /b 0
:publish
call :clean
call git branch -D gh-pages
call git checkout -b gh-pages
call node generate.js lessons docs
call node generate.js wasm docs/webassembly
call mv docs\* .
call git add . || true
call git commit -m 'generating new html' || true
call git push -f origin gh-pages || true
call git checkout master
exit /b 0
:lint
call prettier --write .\lessons\*\*.yaml
call prettier --write .\wasm\*\*.yaml
exit /b 0
:clean
del .\docs\*.html
del .\docs\webassembly\*.html
exit /b 0