File tree Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# Performs a lua-language-server check on all files.
4
4
# lls-check/check.json will be produced on any issues, returning 1.
5
+ # Outputs check.json to stdout, all messages to stderr, to allow jq etc.
5
6
6
- rm -rf lls-check
7
- mkdir lls-check
7
+ VER_LLS=" 3.7.3"
8
8
9
- OUT=$( lua-language-server --checklevel=Information --check . --logpath=lls-check --loglevel=error)
10
- echo " ${OUT} "
9
+ DIR_SRC=" ${PWD} "
10
+ DIR_OUT=" ${DIR_SRC} /lls-out"
11
+ DIR_LLS=" /tmp/lls"
12
+
13
+ # clear output
14
+ rm -rf " ${DIR_OUT} "
15
+ mkdir " ${DIR_OUT} "
16
+
17
+ if [ ! -d " ${DIR_LLS} " ]; then
18
+ # download lua-language-server binaries
19
+ mkdir -p " ${DIR_LLS} "
20
+ curl -L " https://github.com/LuaLS/lua-language-server/releases/download/${VER_LLS} /lua-language-server-${VER_LLS} -linux-x64.tar.gz" | tar zx --directory " ${DIR_LLS} "
21
+ fi
22
+
23
+ # execute from within the lua-language-server directory as it expects specific file locations
24
+ cd " ${DIR_LLS} "
25
+ OUT=$( " ${DIR_LLS} /bin/lua-language-server" --checklevel=Information --check " ${DIR_SRC} " --logpath=" ${DIR_OUT} " --loglevel=error)
26
+ echo " ${OUT} " >&2
11
27
12
28
RC=$?
13
29
if [ $RC -ne 0 ]; then
14
30
echo " failed with RC=$RC "
15
31
exit $RC
16
32
fi
17
33
34
+ # any output is a fail
18
35
case " ${OUT} " in
19
- * Diagnosis\ completed* )
20
- if [ -f " lls-check/check.json" ]; then
36
+ * Diagnosis\ complete* )
37
+ if [ -f " ${DIR_OUT} /check.json" ]; then
38
+ cat " ${DIR_OUT} /check.json"
21
39
exit 1
22
40
else
23
41
exit 0
You can’t perform that action at this time.
0 commit comments