summaryrefslogtreecommitdiff
path: root/script/cli/doc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-02-19 15:26:01 +0800
committerGitHub <noreply@github.com>2024-02-19 15:26:01 +0800
commit7848d0367a89a66207fc4b5e8d6593520bf40ffa (patch)
treead043e5383f446170f839eec298fb15584da14a2 /script/cli/doc.lua
parent6c224b7033f15b2956e0050dc946b948d7ea7fdd (diff)
parent76382f30684fc9486973d5f62d59613d24774d82 (diff)
downloadlua-language-server-7848d0367a89a66207fc4b5e8d6593520bf40ffa.zip
Merge pull request #2526 from AndreasMatthias/doc-output-path
CLI option --doc_out_path <PATH>.
Diffstat (limited to 'script/cli/doc.lua')
-rw-r--r--script/cli/doc.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/script/cli/doc.lua b/script/cli/doc.lua
index 2d2ae81b..fb9b0a8e 100644
--- a/script/cli/doc.lua
+++ b/script/cli/doc.lua
@@ -297,6 +297,18 @@ function export.export(outputPath, callback)
return docPath, mdPath
end
+function export.getDocOutputPath()
+ local doc_output_path = ''
+ if type(DOC_OUT_PATH) == 'string' then
+ doc_output_path = fs.absolute(fs.path(DOC_OUT_PATH)):string()
+ elseif DOC_OUT_PATH == true then
+ doc_output_path = fs.current_path():string()
+ else
+ doc_output_path = LOGPATH
+ end
+ return doc_output_path
+end
+
---@async
---@param outputPath string
function export.makeDoc(outputPath)
@@ -355,7 +367,7 @@ function export.runCLI()
ws.awaitReady(rootUri)
await.sleep(0.1)
- local docPath, mdPath = export.export(LOGPATH, function (i, max)
+ local docPath, mdPath = export.export(export.getDocOutputPath(), function (i, max)
if os.clock() - lastClock > 0.2 then
lastClock = os.clock()
local output = '\x0D'