forked from bakpakin/mendoza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mdz
executable file
·44 lines (35 loc) · 1.25 KB
/
mdz
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
#!/usr/bin/env janet
# Increase interval so GC doesn't slow down program as much.
(gcsetinterval 0x7FFFFF)
(import mendoza :as mdz)
(mdz/init)
(def args (dyn :args))
(def usage
"Script usage."
``` [action]
Actions:
help - Print this usage information
build - Create the static site in the 'site' directory
[site="site"] -- output directory for site
[root="/"] -- url path that site expects to be under on the server
clean - Destroy the static site directory
[site="site"] -- output directory from a previous build
serve - Serves current site. Uses circlet to serve.
[port=8000] -- optional port
[host=127.0.0.1] -- optional host
[site="site"] -- output directory to serve from
watch - Watch files and rebuild on any change.
version - Print the mendoza version
```)
(var action "build")
(if (>= (length args) 2)
(set action (args 1)))
(gccollect)
# Do actions
(case action
"help" (print (args 0) usage)
"version" (print mdz/version)
"clean" (mdz/clean (get args 2))
"serve" (mdz/serve (get args 2) (get args 3) (get args 4))
"watch" (mdz/watch)
"build" (mdz/build (get args 2) (get args 3)))