mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-14 06:07:58 +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
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local cmd = {'curl', '-fLo', plugSpec.path, '--create-dirs', plugSpec.url}
|
local cmd = { 'curl', '-fLo', plugSpec.path, '--create-dirs', plugSpec.url }
|
||||||
on_uidate(plugSpec.name, { command = 'curl'})
|
on_uidate(plugSpec.name, { command = 'curl' })
|
||||||
local jobid = job.start(cmd, {
|
local jobid = job.start(cmd, {
|
||||||
on_exit = function(id, data, single)
|
on_exit = function(id, data, single)
|
||||||
if data == 0 and single == 0 then
|
if data == 0 and single == 0 then
|
||||||
@ -115,8 +115,6 @@ function H.download_raw(plugSpec, force)
|
|||||||
})
|
})
|
||||||
processes = processes + 1
|
processes = processes + 1
|
||||||
jobs['jobid_' .. jobid] = plugSpec.name
|
jobs['jobid_' .. jobid] = plugSpec.name
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param plugSpec PluginSpec
|
--- @param plugSpec PluginSpec
|
||||||
@ -237,7 +235,9 @@ end
|
|||||||
|
|
||||||
M.install = function(plugSpecs)
|
M.install = function(plugSpecs)
|
||||||
for _, v in ipairs(plugSpecs) do
|
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)
|
H.download_raw(v)
|
||||||
else
|
else
|
||||||
H.install_plugin(v)
|
H.install_plugin(v)
|
||||||
@ -247,7 +247,9 @@ end
|
|||||||
|
|
||||||
M.update = function(plugSpecs, force)
|
M.update = function(plugSpecs, force)
|
||||||
for _, v in ipairs(plugSpecs) do
|
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)
|
H.download_raw(v, force)
|
||||||
else
|
else
|
||||||
H.update_plugin(v, force)
|
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 add_raw_rtp = false
|
||||||
local loaded_plugins = {}
|
local loaded_plugins = {}
|
||||||
|
|
||||||
|
|
||||||
--- @class PluginSpec
|
--- @class PluginSpec
|
||||||
--- @field rtp string
|
--- @field rtp string
|
||||||
--- @field events table<string>
|
--- @field events table<string>
|
||||||
@ -108,7 +107,11 @@ function M.parser(plugSpec)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.load(plugSpec)
|
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)
|
vim.opt.runtimepath:append(plugSpec.rtp)
|
||||||
loaded_plugins[plugSpec.name] = true
|
loaded_plugins[plugSpec.name] = true
|
||||||
if type(plugSpec.config) == 'function' then
|
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)
|
local function count_done(p)
|
||||||
done = 0
|
done = 0
|
||||||
for _, v in pairs(p) do
|
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
|
done = done + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -42,7 +42,9 @@ local function build_context()
|
|||||||
local b = base()
|
local b = base()
|
||||||
|
|
||||||
for k, plug in pairs(plugin_status) do
|
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
|
if plug.pull_done then
|
||||||
table.insert(b, '√ ' .. k .. ' updated')
|
table.insert(b, '√ ' .. k .. ' updated')
|
||||||
elseif plug.pull_done == false then
|
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',
|
'wsdjeg/vim-async-dict',
|
||||||
frozen = true,
|
frozen = true,
|
||||||
|
Loading…
Reference in New Issue
Block a user