-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpctl
More file actions
executable file
·48 lines (37 loc) · 651 Bytes
/
pctl
File metadata and controls
executable file
·48 lines (37 loc) · 651 Bytes
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
#!/bin/bash
set -eou pipefail
BIN_DIR="$(dirname "$(realpath "$0")")"
ROOT_DIR="$(dirname "$BIN_DIR")"
LUAROCKS="luarocks-5.1"
exists() {
command -v "$1" > /dev/null
}
setup(){
exists luarocks-5.1 || {
exists luarocks && {
LUAROCKS="luarocks --lua-version 5.1"
} || {
echo 'Please install luarocks'
exit 1
}
}
$LUAROCKS install "$1"
}
tests(){
exists busted || setup busted
busted
}
linter(){
exists luacheck || setup luacheck
luacheck lua/
}
run() {
tests
linter
}
run-dev(){
inotifywait -r -q -m -e close_write --format %e lua spec | while read -r ; do
busted
done
}
cd $ROOT_DIR && "$@"