Skip to content

Commit 4819a7a

Browse files
authored
Merge pull request #2364 from 9999years/check-out-path
Add `--check_out_path` CLI argument
2 parents 333d047 + 00ad081 commit 4819a7a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

script/cli/check.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ end
9999
if count == 0 then
100100
print(lang.script('CLI_CHECK_SUCCESS'))
101101
else
102-
local outpath = LOGPATH .. '/check.json'
102+
local outpath = CHECK_OUT_PATH
103+
if outpath == nil then
104+
outpath = LOGPATH .. '/check.json'
105+
end
103106
util.saveFile(outpath, jsonb.beautify(results))
104107

105108
print(lang.script('CLI_CHECK_RESULTS', count, outpath))

script/global.d.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ DOC = ''
5555
---@type string | '"Error"' | '"Warning"' | '"Information"' | '"Hint"'
5656
CHECKLEVEL = 'Warning'
5757

58+
--Where to write the check results (JSON).
59+
--
60+
--If nil, use `LOGPATH/check.json`.
61+
---@type string|nil
62+
CHECK_OUT_PATH = ''
63+
5864
---@type 'trace' | 'debug' | 'info' | 'warn' | 'error'
5965
LOGLEVEL = 'warn'
6066

0 commit comments

Comments
 (0)