mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-14 03:18:01 +08:00
feat(installer): skip local plugin
This commit is contained in:
parent
0532e157f3
commit
1d63b392be
14
bundle/nvim-plug/lua/plug/installer.lua
vendored
14
bundle/nvim-plug/lua/plug/installer.lua
vendored
@ -92,8 +92,8 @@ function H.download_raw(plugSpec, force)
|
||||
return
|
||||
end
|
||||
|
||||
local cmd = {'curl', '-fLo', plugSpec.path, '--create-dirs', plugSpec.url}
|
||||
on_uidate(plugSpec.name, { command = 'curl'})
|
||||
local cmd = { 'curl', '-fLo', plugSpec.path, '--create-dirs', plugSpec.url }
|
||||
on_uidate(plugSpec.name, { command = 'curl' })
|
||||
local jobid = job.start(cmd, {
|
||||
on_exit = function(id, data, single)
|
||||
if data == 0 and single == 0 then
|
||||
@ -115,8 +115,6 @@ function H.download_raw(plugSpec, force)
|
||||
})
|
||||
processes = processes + 1
|
||||
jobs['jobid_' .. jobid] = plugSpec.name
|
||||
|
||||
|
||||
end
|
||||
|
||||
--- @param plugSpec PluginSpec
|
||||
@ -237,7 +235,9 @@ end
|
||||
|
||||
M.install = function(plugSpecs)
|
||||
for _, v in ipairs(plugSpecs) do
|
||||
if v.type == 'raw' then
|
||||
if v.is_local then
|
||||
on_uidate(v.name, {is_local = true})
|
||||
elseif v.type == 'raw' then
|
||||
H.download_raw(v)
|
||||
else
|
||||
H.install_plugin(v)
|
||||
@ -247,7 +247,9 @@ end
|
||||
|
||||
M.update = function(plugSpecs, force)
|
||||
for _, v in ipairs(plugSpecs) do
|
||||
if v.type == 'raw' then
|
||||
if v.is_local then
|
||||
on_uidate(v.name, {is_local = true})
|
||||
elseif v.type == 'raw' then
|
||||
H.download_raw(v, force)
|
||||
else
|
||||
H.update_plugin(v, force)
|
||||
|
7
bundle/nvim-plug/lua/plug/loader.lua
vendored
7
bundle/nvim-plug/lua/plug/loader.lua
vendored
@ -12,7 +12,6 @@ local config = require('plug.config')
|
||||
local add_raw_rtp = false
|
||||
local loaded_plugins = {}
|
||||
|
||||
|
||||
--- @class PluginSpec
|
||||
--- @field rtp string
|
||||
--- @field events table<string>
|
||||
@ -108,7 +107,11 @@ function M.parser(plugSpec)
|
||||
end
|
||||
|
||||
function M.load(plugSpec)
|
||||
if plugSpec.rtp and vim.fn.isdirectory(plugSpec.rtp) == 1 and not loaded_plugins[plugSpec.name] then
|
||||
if
|
||||
plugSpec.rtp
|
||||
and vim.fn.isdirectory(plugSpec.rtp) == 1
|
||||
and not loaded_plugins[plugSpec.name]
|
||||
then
|
||||
vim.opt.runtimepath:append(plugSpec.rtp)
|
||||
loaded_plugins[plugSpec.name] = true
|
||||
if type(plugSpec.config) == 'function' then
|
||||
|
6
bundle/nvim-plug/lua/plug/ui.lua
vendored
6
bundle/nvim-plug/lua/plug/ui.lua
vendored
@ -17,7 +17,7 @@ local plugin_status = {}
|
||||
local function count_done(p)
|
||||
done = 0
|
||||
for _, v in pairs(p) do
|
||||
if v.command and v[v.command .. '_done'] then
|
||||
if v.command and v[v.command .. '_done'] or v.is_local then
|
||||
done = done + 1
|
||||
end
|
||||
end
|
||||
@ -42,7 +42,9 @@ local function build_context()
|
||||
local b = base()
|
||||
|
||||
for k, plug in pairs(plugin_status) do
|
||||
if plug.command == 'pull' then
|
||||
if plug.is_local then
|
||||
table.insert(b, '√ ' .. k .. ' skip local plugin')
|
||||
elseif plug.command == 'pull' then
|
||||
if plug.pull_done then
|
||||
table.insert(b, '√ ' .. k .. ' updated')
|
||||
elseif plug.pull_done == false then
|
||||
|
3
bundle/nvim-plug/test/init.lua
vendored
3
bundle/nvim-plug/test/init.lua
vendored
@ -41,6 +41,9 @@ require('plug').add({
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
'D:/wsdjeg/winbar2.nvim',
|
||||
},
|
||||
{
|
||||
'wsdjeg/vim-async-dict',
|
||||
frozen = true,
|
||||
|
Loading…
Reference in New Issue
Block a user