1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:40:06 +08:00

fix(api): clear package.loaded after import api

This commit is contained in:
wsdjeg 2022-10-07 13:55:29 +08:00
parent 73069ba781
commit 53a2413d14

View File

@ -12,9 +12,13 @@ local M = {}
-- local logger = require('spacevim.logger')
function M.import(name)
local ok, rst = pcall(require, 'spacevim.api.' .. name)
local p = 'spacevim.api.' .. name
local ok, rst = pcall(require, p)
if ok then
package.loaded[p] = nil
return rst
else
return nil
end
end