Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lua-language-server-srb2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LJ Sonic
lua-language-server-srb2
Commits
bdd3f349
Commit
bdd3f349
authored
5 years ago
by
最萌小汐
Browse files
Options
Downloads
Patches
Plain Diff
更新platform
parent
78b54ce5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
platform.lua
+22
-22
22 additions, 22 deletions
platform.lua
with
22 additions
and
22 deletions
platform.lua
+
22
−
22
View file @
bdd3f349
local
script
=
...
local
currentPath
=
debug.getinfo
(
1
,
'S'
).
source
:
sub
(
2
)
local
rootPath
=
currentPath
:
gsub
(
'[^/\\]-$'
,
''
)
if
package.loadlib
(
rootPath
..
'bin/Windows/bee.dll'
,
'luaopen_bee_platform'
)
then
if
rootPath
==
''
then
rootPath
=
'.\\'
else
rootPath
=
rootPath
:
gsub
(
'/'
,
'\\'
)
local
function
findExePath
()
local
n
=
0
while
arg
[
n
-
1
]
do
n
=
n
-
1
end
package.cpath
=
rootPath
..
'bin\\Windows\\?.dll'
package.path
=
rootPath
..
script
..
'
\\
?.lua'
..
';'
..
rootPath
..
script
..
'
\\
?\\init.lua'
elseif
package.loadlib
(
rootPath
..
'bin/macOS/bee.so'
,
'luaopen_bee_platform'
)
then
if
rootPath
==
''
then
rootPath
=
'./'
return
arg
[
n
]
end
package.cpath
=
rootPath
..
'macOS/bin/?.so'
package.path
=
rootPath
..
script
..
'/?.lua'
..
';'
..
rootPath
..
script
..
'/?/init.lua'
elseif
package.loadlib
(
rootPath
..
'bin/Linux/bee.so'
,
'luaopen_bee_platform'
)
then
if
rootPath
==
''
then
rootPath
=
'./'
local
exePath
=
findExePath
()
local
exeDir
=
exePath
:
gsub
(
'[^/\\]-$'
,
''
)
local
dll
=
exePath
:
sub
(
-
4
)
==
'.exe'
and
'.dll'
or
'.so'
package.cpath
=
exeDir
..
'?'
..
dll
if
not
package.loadlib
(
'bee'
..
dll
,
'luaopen_bee_platform'
)
then
error
(
[[It doesn't seem to support your OS, please let me know at https://github.com/sumneko/lua-language-server/issues]]
)
end
package.cpath
=
rootPath
..
'bin/Linux/?.so'
local
fs
=
require
'bee.filesystem'
local
rootPath
=
fs
.
path
(
exePath
):
parent_path
():
parent_path
():
remove_filename
():
string
()
if
dll
==
'.dll'
then
rootPath
=
rootPath
:
gsub
(
'/'
,
'\\'
)
package.path
=
rootPath
..
script
..
'
\\
?.lua'
..
';'
..
rootPath
..
script
..
'
\\
?\\init.lua'
else
rootPath
=
rootPath
:
gsub
(
'\\'
,
'/'
)
package.path
=
rootPath
..
script
..
'/?.lua'
..
';'
..
rootPath
..
script
..
'/?/init.lua'
else
error
(
[[It doesn't seem to support your OS, please let me know at https://github.com/sumneko/lua-language-server/issues]]
)
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment