summaryrefslogtreecommitdiff
path: root/script-beta/workspace/require-path.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/workspace/require-path.lua')
-rw-r--r--script-beta/workspace/require-path.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script-beta/workspace/require-path.lua b/script-beta/workspace/require-path.lua
index 283e0112..79642a7f 100644
--- a/script-beta/workspace/require-path.lua
+++ b/script-beta/workspace/require-path.lua
@@ -1,3 +1,4 @@
+local platform = require 'bee.platform'
local m = {}
m.cache = {}
@@ -35,6 +36,11 @@ function m.getVisiblePath(path, searchers)
end
pos = path:match('[/\\]+()', pos)
for _, searcher in ipairs(searchers) do
+ if platform.OS == 'Windows' then
+ searcher = searcher:gsub('[/\\]+', '\\')
+ else
+ searcher = searcher:gsub('[/\\]+', '/')
+ end
local expect = getOnePath(cutedPath, searcher)
if expect then
if head then