Skip to content

Commit 8390e63

Browse files
authored
Merge branch 'master' into fix_doc_config
2 parents 2c4b699 + 6618c2f commit 8390e63

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<!-- Add all new changes here. They will be moved under a version at release -->
55
* `FIX` incorrect argument skip pattern for `--check_out_path=`, which incorrectly skips the next argument
66
* `FIX` reimplement section `luals.config` in file doc.json
7+
* `FIX` incorrect file names in file doc.json
78
* `FIX` remove extra `./` path prefix in the check report when using `--check=.`
89

910
## 3.13.6

script/cli/doc/export.lua

+7-6
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ local furi = require 'file-uri'
5757
local export = {}
5858

5959
function export.getLocalPath(uri)
60-
--remove uri root (and prefix)
61-
local local_file_uri = uri
62-
local i, j = local_file_uri:find(DOC)
63-
if not j then
64-
return '[FOREIGN] '..uri
60+
local file_canonical = fs.canonical(furi.decode(uri)):string()
61+
local doc_canonical = fs.canonical(DOC):string()
62+
local relativePath = fs.relative(file_canonical, doc_canonical):string()
63+
if relativePath == "" or relativePath:sub(1, 2) == '..' then
64+
-- not under project directory
65+
return '[FOREIGN] ' .. file_canonical
6566
end
66-
return local_file_uri:sub( j + 1 )
67+
return relativePath
6768
end
6869

6970
function export.positionOf(rowcol)

script/cli/doc/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function doc.runCLI()
185185
return
186186
end
187187

188-
local rootUri = furi.encode(fs.absolute(fs.path(DOC)):string())
188+
local rootUri = furi.encode(fs.canonical(fs.path(DOC)):string())
189189
if not rootUri then
190190
print(lang.script('CLI_CHECK_ERROR_URI', DOC))
191191
return

0 commit comments

Comments
 (0)