mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-23 17:49:57 +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')
|
-- local logger = require('spacevim.logger')
|
||||||
|
|
||||||
function M.import(name)
|
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
|
if ok then
|
||||||
|
package.loaded[p] = nil
|
||||||
return rst
|
return rst
|
||||||
|
else
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user