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 22
33# Performs a lua-language-server check on all files.
44# 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.
56
6- rm -rf lls-check
7- mkdir lls-check
7+ VER_LLS=" 3.7.3"
88
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
1127
1228RC=$?
1329if [ $RC -ne 0 ]; then
1430 echo " failed with RC=$RC "
1531 exit $RC
1632fi
1733
34+ # any output is a fail
1835case " ${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"
2139 exit 1
2240 else
2341 exit 0
You can’t perform that action at this time.
0 commit comments