diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/core/command/getConfig.lua | 7 | ||||
-rw-r--r-- | script/core/command/setConfig.lua | 10 |
2 files changed, 14 insertions, 3 deletions
diff --git a/script/core/command/getConfig.lua b/script/core/command/getConfig.lua index 86a06b88..dd0b504b 100644 --- a/script/core/command/getConfig.lua +++ b/script/core/command/getConfig.lua @@ -1,5 +1,10 @@ local config = require 'config' +local ws = require 'workspace' +---@async return function (data) - return config.get(data[1].uri, data[1].key) + local uri = data[1].uri + local key = data[1].key + ws.awaitReady(uri) + return config.get(uri, key) end diff --git a/script/core/command/setConfig.lua b/script/core/command/setConfig.lua index 84062dd1..c61aa942 100644 --- a/script/core/command/setConfig.lua +++ b/script/core/command/setConfig.lua @@ -1,5 +1,11 @@ local client = require 'client' +local ws = require 'workspace' -return function (data) - client.setConfig(data) +---@async +---@param changes config.change[] +return function (changes) + for _, change in ipairs(changes) do + ws.awaitReady(change.uri) + end + client.setConfig(changes) end |