Skip to content

Commit 4db8d89

Browse files
committed
feat(unfinished): check archived plugins
1 parent ac1c195 commit 4db8d89

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

lua/aceforeverd/init.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ function M.setup()
4141

4242
require('aceforeverd.plugins').setup()
4343

44+
vim.api.nvim_create_user_command('GetOldPlugins', [[lua require('aceforeverd.plugins.util').GetOldPlugins()]], {})
45+
4446
-- keep vim default maps
4547
-- set_map('x', ']"', '"', { noremap = true, silent = true })
4648
end

lua/aceforeverd/plugins/util.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
local base = 'https://api.github.com/repo/'
2+
3+
function GetRepo(repo)
4+
local curl = require('plenary.curl')
5+
return curl.get(base .. repo)
6+
end
7+
8+
function GetOldPlugins()
9+
local plugins = vim.fn['minpac#getpluglist']()
10+
local out = {}
11+
for _, value in pairs(plugins) do
12+
local url = value['url']
13+
local repo = vim.fn.substitute(url, [[^https://github.com/]], '', '')
14+
local stats = GetRepo(repo)
15+
16+
if stats ~= nil and stats.archived == true then
17+
table.insert(out, {value, 'archived'})
18+
end
19+
end
20+
21+
vim.api.nvim_notify(vim.inspect(out), vim.log.levels.INFO, {})
22+
end
23+
24+
return {
25+
GetOldPlugins = GetOldPlugins
26+
}

0 commit comments

Comments
 (0)