-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.cmd
68 lines (56 loc) · 1.42 KB
/
build.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@echo off
setlocal
curl -s https://redbean.dev/latest.txt >redbean-latest.txt
set /p version=<redbean-latest.txt
if defined version (
echo Found the latest version of redbean: %version%
) else (
echo Could not find the latest version info for redbean.
exit /b
)
set redbean=redbean-tiny-%version%.com
set ASSETS=.args .init.lua index.lua
set WIKI=wiki.html
if not exist %redbean% (
echo Attemping to download %redbean%
curl -s https://redbean.dev/%redbean% > %redbean%
if not exist %redbean% (
echo [31mFailed.[0m
exit /b
) else (
echo [32mSuccess[0m
)
) else (
echo Found %redbean%
)
echo.
if not exist %WIKI% (
echo Trying to download TiddlyWiki empty.html
curl -s https://tiddlywiki.com/empty.html >%WIKI%
if not exist %WIKI% (
echo [31mFailed.[0m
exit /b
) else (
echo [32mSuccess[0m
)
) else (
echo Found %WIKI%
)
echo.
zip >nul
if %errorlevel% neq 0 (
echo Did not find a zip command. Attempting to download
curl -s https://redbean.dev/zip.com >zip.com
if exist zip.com (
echo [32mSuccess[0m
) else (
echo [32mSuccess[0m
)
) else (
echo Found a zip command
)
echo.
echo Creating wiki.com
copy %redbean% wiki.com >nul
zip wiki.com %ASSETS% %WIKI%
rem echo ERRORLEVEL: %ERRORLEVEL%