-
Notifications
You must be signed in to change notification settings - Fork 47
/
stool.sibilant
executable file
·58 lines (43 loc) · 2.34 KB
/
stool.sibilant
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
#!/usr/bin/env sibilant -x
(include "stool/include/stool")
(import-namespace stool)
(command build "rebuilds this sibilant with itself and package.json"
(exec "sibilant src/sibilant.sibilant src/cli.sibilant src/repl.sibilant src/options.sibilant src/browser.sibilant -o lib -m maps" next))
(command package "rebuilds the npm package json"
(exec "sibilant package.son -o" next))
(command clean "uses git to revert to a clean sibilant product. src remains unchanged"
(exec "git checkout `git ls-files lib` package.json" next))
(command test "runs sibilant test suite"
(exec "bin/sibilant -x test/test.sibilant" next))
(command docs-text "rebuilds sibilant text docs"
(exec "bin/sibilant -d text-no-color > docs/docs.txt" next))
(command docs-json "rebuilds sibilant json docs"
(exec "bin/sibilant -d json > docs/docs.json" next))
(command scss "compiles public scss"
(exec "scss public/screen.scss > public/screen.css" next))
(command tag "git tag current package version"
(var { version } (require "./package.json"))
(exec ("git tag v" version) next))
(command push-tag "push git tag for current package version"
(var { version } (require "./package.json"))
(exec ("git push origin v" version) next))
(command npm-publish "publishes current build to npm"
(exec "npm publish" next))
(command require-clean "checks that local repo is the same as origin/main"
(console.log "\nChecking if local repo is the same as origin/main:")
(child-process.exec
"git diff --shortstat origin/main..HEAD ."
(#(err output)
(if (= "" output)
(do (console.log "Yes, up to date.\n") (next))
(console.log "Repo is not clean, please stash or commit\n\t" output)))))
(command upload-s3 "uploads public site to sibilantjs.info"
(console.log "Syncing to amazon s3")
(exec (concat "aws s3 sync public s3://sibilant.org/ --region us-east-1 "
"--acl public-read --exclude \".sass-cache/*\"") next))
(sequence publish-site "publishes public site"
[ scss require-clean upload-s3 ])
(sequence docs "rebuilds sibilant docs" [ docs-text docs-json ])
(sequence all [ clean build package test docs ])
(sequence default-command [ build test docs ])
(sequence publish [ package require-clean tag push-tag npm-publish ])