-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathx
executable file
·74 lines (56 loc) · 977 Bytes
/
x
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
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
set -o noglob
cmd:format() {
deno fmt src
}
cmd:check() {
deno lint src
deno fmt --check src
npx tsc --noEmit
}
cmd:dev() {
set +o noglob
mkdir -p dist
npx esbuild src/index.ts \
--bundle \
--outfile=static/bundle.js \
--watch=forever \
--servedir=static \
--platform=node \
--serve-fallback=static/index.html \
--serve=8080
set -o noglob
}
cmd:build() {
mkdir -p dist
set +o noglob
cp -r static/* dist
set -o noglob
npx esbuild src/index.ts \
--bundle \
--minify \
--platform=node \
--outfile=dist/bundle.js \
}
cmd:publish() {
git branch -D production || true
git checkout -b production main
npm install
cmd:build
ls | grep -v dist | xargs rm -rf
set +o noglob
mv dist/* .
set -o noglob
rm -rf dist
git add .
git commit -m "Publish"
git push -f
git checkout main
}
(
cd $(dirname "$0")
"cmd:$@"
)