-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake
executable file
·56 lines (49 loc) · 971 Bytes
/
make
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
#!/bin/bash
# Exit if error
set -e
# Operate in current direcory
cd $(dirname $0)
# Variables
LANG="python3"
MINIFY=0
DEBUG=0
# Help
function help {
echo "Usage: $0 [-l|--lang lang] [-m|--minify] [-d|--debug] [-h|--help]"
echo " Makes the parser with the current configuration and places in './build/parsers'"
echo " -l|--lang [lang]: Which language the parser is for"
echo " -m|--minify: Optimizes the parser, will not be human-readable"
echo " -d|--debug: Enables debugging info"
echo " -h|--help: Prints this help text"
}
# Ensure npm installed
NPM="$(which npm)"
if [ "$NPM" == "" ]; then
echo "npm not installed"
exit 1
fi
while (( "$#" )); do
case "$1" in
-l|--lang)
LANG="$2"
shift 2
;;
-m|--minify)
MINIFY=1
shift
;;
-d|--debug)
DEBUG=1
shift
;;
-h|--help)
help
exit
;;
*)
echo "Unknown flag $1"
exit 127
esac
done
$NPM run build -- --env.langs="$LANG" --env.optimize=$MINIFY --env.enable_debug=$DEBUG
exit