-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·57 lines (48 loc) · 969 Bytes
/
build.sh
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
#!/usr/bin/env bash
watch=0
no_jekyll=0
while [[ $# -gt 0 ]]; do
case "$1" in
-w|--watch)
watch=1
shift
;;
-J|--no-jekyll)
no_jekyll=1
shift
;;
*)
break
;;
esac
done
set -e
if [[ -d bin ]]; then
export PATH="$(realpath bin):$PATH"
fi
echo "Generating images..."
./gen-icon.sh --background white assets/opengraph-*.svg assets/twitter-*.svg &
asset_job=$!
./gen-icon.sh favicon/favicon.svg --sizes=512,256,255,192,180,150,128,96,72,64,48,32,24,20,16 --apple &
favicon_job=$!
wait -n "$asset_job"
wait -n "$favicon_job"
echo "Done"
echo "Compiling Sass..."
bundler exec sass --update scss:css
if [[ watch -ne 0 ]]; then
bundler exec sass --update --watch scss:css &
fi
echo "Done"
if [[ -d node_modules/.bin ]]; then
export PATH="$(realpath node_modules/.bin):$PATH"
fi
echo "Compiling TypeScript..."
tsc
if [[ watch -ne 0 ]]; then
tsc --watch &
fi
echo "Done"
if [[ no_jekyll -eq 0 ]]; then
bundler exec jekyll build "$@"
fi