Skip to content

Commit 0214d09

Browse files
committed
check plugin folder before load
1 parent 4bbc46c commit 0214d09

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lua/strive/init.lua

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -714,13 +714,16 @@ function Plugin:load(do_action, callback)
714714
vim.opt.rtp:append(after_path)
715715
end
716716

717-
local result = Async.try_await(self:load_scripts())
718-
if result.error then
719-
M.log(
720-
'error',
721-
string.format('Failed to load scripts for %s: %s', self.name, tostring(result.error))
722-
)
723-
return
717+
local plugin_dir = joinpath(plugin_path, 'plugin')
718+
if isdir(plugin_dir) then
719+
local result = Async.try_await(self:load_scripts())
720+
if result.error then
721+
M.log(
722+
'error',
723+
string.format('Failed to load scripts for %s: %s', self.name, tostring(result.error))
724+
)
725+
return
726+
end
724727
end
725728

726729
self.loaded = true

0 commit comments

Comments
 (0)