summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu, Zhenyu <wuzhenyu@ustc.edu>2024-07-30 01:04:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-08-15 14:50:48 +0800
commita05f52abf03c47992b4488ede95ad0c4b6484bed (patch)
tree0ed5cc7b8a7150e4ee58f192ad356219d43964a7
parent1d515a0efff310dd91bf3c8ac7a06aced9473622 (diff)
downloadlua-language-server-a05f52abf03c47992b4488ede95ad0c4b6484bed.zip
Fix lua-language-server --check (#2683)
-rw-r--r--script/cli/check.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/cli/check.lua b/script/cli/check.lua
index 8b314f24..c3aac0e3 100644
--- a/script/cli/check.lua
+++ b/script/cli/check.lua
@@ -8,7 +8,12 @@ local util = require 'utility'
local numThreads = tonumber(NUM_THREADS or 1)
-local exe = arg[-1]
+local exe
+local minIndex = -1
+while arg[minIndex] do
+ exe = arg[minIndex]
+ minIndex = minIndex - 1
+end
-- TODO: is this necessary? got it from the shell.lua helper in bee.lua tests
if platform.os == 'windows' and not exe:match('%.[eE][xX][eE]$') then
exe = exe..'.exe'