Skip to content

Commit af4981c

Browse files
committed
fix: use luarocks.core.sysdetect to detect windows
1 parent 7ef5560 commit af4981c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

bin/lls-addons

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env lua
2-
local PATH_SEP = package.config:sub(3, 3)
2+
local sysdetect = require("luarocks.core.sysdetect")
3+
4+
local system = sysdetect.detect()
35

46
local Q
5-
if PATH_SEP == "\\" then
7+
if system == "windows" then
68
-- copied from luarocks/fs/win32.lua
79
function Q(arg)
810
assert(type(arg) == "string")
@@ -55,7 +57,7 @@ else
5557
end
5658
end
5759

58-
local cmd = { "luarocks", "--lua-version 5.5", ... }
60+
local cmd = { "luarocks", Q("--lua-version 5.5"), ... }
5961
for i = 3, select("#", ...) + 2 do
6062
cmd[i] = Q(cmd[i])
6163
end

0 commit comments

Comments
 (0)