Skip to content

Commit dd3bf8c

Browse files
authored
Merge pull request #1145 from kevinhwang91/check-jsonc-exist
fix(client): check .luarc.jsonc existed
2 parents cbcbab9 + f63ac95 commit dd3bf8c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

script/client.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
local fs = require 'bee.filesystem'
12
local nonil = require 'without-check-nil'
23
local util = require 'utility'
34
local lang = require 'language'
@@ -247,11 +248,11 @@ local function tryModifyRC(uri, finalChanges, create)
247248
return false
248249
end
249250
local workspace = require 'workspace'
250-
local path = workspace.getAbsolutePath(uri, '.luarc.json')
251-
or workspace.getAbsolutePath(uri, '.luarc.jsonc')
251+
local path = workspace.getAbsolutePath(uri, '.luarc.jsonc')
252252
if not path then
253253
return false
254254
end
255+
path = fs.exists(path) and path or workspace.getAbsolutePath(uri, '.luarc.json')
255256
local buf = util.loadFile(path)
256257
if not buf and not create then
257258
return false

0 commit comments

Comments
 (0)