diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-10-12 14:02:42 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-10-12 14:39:09 +0800 |
commit | 43773eb3c4e9e5477076dcc2e314f72bda207c2d (patch) | |
tree | d4e425058590874375cb2ae0d15351d449688286 | |
parent | 77bf68899e2553cad7c23ff3822301e1b84f9c08 (diff) | |
download | lua-language-server-43773eb3c4e9e5477076dcc2e314f72bda207c2d.zip |
update bootstrap
-rw-r--r-- | make/bootstrap.lua | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/make/bootstrap.lua b/make/bootstrap.lua index 021252c5..43dcdf5f 100644 --- a/make/bootstrap.lua +++ b/make/bootstrap.lua @@ -42,12 +42,21 @@ local root; do root = package.cpath:match("([^;]+)"..pattern..pattern..pattern.."$")
end
-local fs = require "bee.filesystem"
+local fs = require 'bee.filesystem'
fs.current_path(fs.path(root))
-
package.path = table.concat({
- root .. "/script/?.lua",
- root .. "/script/?/init.lua",
-}, ";")
+ "script/?.lua",
+ "script/?/init.lua",
+}, ";"):gsub('/', package.config:sub(1,1))
+
+loadfile = function (name)
+ local f, e = io.open(root .. '/' .. name)
+ if not f then
+ return false, e
+ end
+ local content = f:read 'a'
+ f:close()
+ return load(content, '@' .. name)
+end
assert(loadfile(arg[0]))(table.unpack(arg))
|