summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-10-18 13:58:59 +0800
committerGitHub <noreply@github.com>2023-10-18 13:58:59 +0800
commit4819a7ad29ab38f6cec0c04e767494d6130f46b2 (patch)
tree6c04aebc9586d2511a98ea99e90a57bcebbb20c9 /script
parent333d047365bae2fbe5b7b1147fad6aee82e4c8e6 (diff)
parent00ad081732cfd1dc7e340597f2000de751960471 (diff)
downloadlua-language-server-4819a7ad29ab38f6cec0c04e767494d6130f46b2.zip
Merge pull request #2364 from 9999years/check-out-path
Add `--check_out_path` CLI argument
Diffstat (limited to 'script')
-rw-r--r--script/cli/check.lua5
-rw-r--r--script/global.d.lua6
2 files changed, 10 insertions, 1 deletions
diff --git a/script/cli/check.lua b/script/cli/check.lua
index 323ea74b..4295fa06 100644
--- a/script/cli/check.lua
+++ b/script/cli/check.lua
@@ -99,7 +99,10 @@ end
if count == 0 then
print(lang.script('CLI_CHECK_SUCCESS'))
else
- local outpath = LOGPATH .. '/check.json'
+ local outpath = CHECK_OUT_PATH
+ if outpath == nil then
+ outpath = LOGPATH .. '/check.json'
+ end
util.saveFile(outpath, jsonb.beautify(results))
print(lang.script('CLI_CHECK_RESULTS', count, outpath))
diff --git a/script/global.d.lua b/script/global.d.lua
index aedcc38c..b44d6371 100644
--- a/script/global.d.lua
+++ b/script/global.d.lua
@@ -55,6 +55,12 @@ DOC = ''
---@type string | '"Error"' | '"Warning"' | '"Information"' | '"Hint"'
CHECKLEVEL = 'Warning'
+--Where to write the check results (JSON).
+--
+--If nil, use `LOGPATH/check.json`.
+---@type string|nil
+CHECK_OUT_PATH = ''
+
---@type 'trace' | 'debug' | 'info' | 'warn' | 'error'
LOGLEVEL = 'warn'