Skip to content

Commit 672bec9

Browse files
committed
#269 workspace.library should be normalized first
1 parent 33caa51 commit 672bec9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: script/workspace/workspace.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ function m.getLibraryMatchers()
134134

135135
local librarys = {}
136136
for path, pattern in pairs(config.config.workspace.library) do
137-
librarys[path] = pattern
137+
librarys[m.normalize(path)] = pattern
138138
end
139139
if library.metaPath then
140-
librarys[library.metaPath] = true
140+
librarys[m.normalize(library.metaPath)] = true
141141
end
142142
m.libraryMatchers = {}
143143
for path, pattern in pairs(librarys) do
@@ -294,11 +294,13 @@ end
294294
function m.normalize(path)
295295
if platform.OS == 'Windows' then
296296
path = path:gsub('[/\\]+', '\\')
297+
:gsub('[/\\]+$', '')
297298
:gsub('^%a+%:', function (str)
298299
return str:upper()
299300
end)
300301
else
301302
path = path:gsub('[/\\]+', '/')
303+
:gsub('[/\\]+$', '')
302304
end
303305
return path:gsub('^[/\\]+', '')
304306
end

0 commit comments

Comments
 (0)