Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add --check_out_path CLI argument #2364

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion script/cli/check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 6 additions & 0 deletions script/global.d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down