mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 22:30:04 +08:00
fix(api): clear package.loaded after import api
This commit is contained in:
parent
73069ba781
commit
53a2413d14
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user