-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunme
executable file
·47 lines (39 loc) · 899 Bytes
/
runme
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
#!/bin/sh
set -e
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " repl - start repl"
echo " tests - run tests"
echo ""
echo "For help with each subcommand run:"
echo "$ProgName <subcommand> -h|--help"
echo ""
}
sub_repl(){
echo "Starting repl..."
clj -A:test:nrepl -e "(-main)"
}
sub_tests(){
echo "Running tests..."
export CHAT_SECRET="Basic secret"
clj -A:test:runner $@
}
subcommand=$1
case $subcommand in
"" | "-h" | "--help")
sub_help
;;
*)
shift
sub_${subcommand} $@
code=$?
if [ $code = 127 ]; then
echo "Error: '$subcommand' is not a known subcommand." >&2
echo " Run '$ProgName --help' for a list of known subcommands." >&2
exit 1
else
exit $code
fi
;;
esac