mirror of
https://github.com/nvim-tree/nvim-tree.lua
synced 2024-09-16 14:34:03 +02:00
4c8ddee453
* add lua-language-server 3.9.1 * remove lua-language-server 3.7.3
40 lines
937 B
Bash
Executable file
40 lines
937 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# Performs a lua-language-server check on all files.
|
|
# luals-out/check.json will be produced on any issues, returning 1.
|
|
# Outputs only check.json to stdout, all other messages to stderr, to allow jq etc.
|
|
# $VIMRUNTIME specifies neovim runtime path, defaults to "/usr/share/nvim/runtime" if unset.
|
|
|
|
if [ -z "${VIMRUNTIME}" ]; then
|
|
export VIMRUNTIME="/usr/share/nvim/runtime"
|
|
fi
|
|
|
|
DIR_SRC="lua"
|
|
DIR_OUT="luals-out"
|
|
|
|
# clear output
|
|
rm -rf "${DIR_OUT}"
|
|
mkdir "${DIR_OUT}"
|
|
|
|
# execute inside lua to prevent luals itself from being checked
|
|
OUT=$(lua-language-server --check="${DIR_SRC}" --configpath="${PWD}/.luarc.json" --checklevel=Information --logpath="${DIR_OUT}" --loglevel=error)
|
|
RC=$?
|
|
|
|
echo "${OUT}" >&2
|
|
|
|
if [ $RC -ne 0 ]; then
|
|
echo "failed with RC=$RC"
|
|
exit $RC
|
|
fi
|
|
|
|
# any output is a fail
|
|
case "${OUT}" in
|
|
*Diagnosis\ completed,\ no\ problems\ found*)
|
|
exit 0
|
|
;;
|
|
*)
|
|
cat "${DIR_OUT}/check.json"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|