-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(unfinished): check archived plugins
- Loading branch information
1 parent
ac1c195
commit 4db8d89
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
local base = 'https://api.github.com/repo/' | ||
|
||
function GetRepo(repo) | ||
local curl = require('plenary.curl') | ||
return curl.get(base .. repo) | ||
end | ||
|
||
function GetOldPlugins() | ||
local plugins = vim.fn['minpac#getpluglist']() | ||
local out = {} | ||
for _, value in pairs(plugins) do | ||
local url = value['url'] | ||
local repo = vim.fn.substitute(url, [[^https://github.com/]], '', '') | ||
local stats = GetRepo(repo) | ||
|
||
if stats ~= nil and stats.archived == true then | ||
table.insert(out, {value, 'archived'}) | ||
end | ||
end | ||
|
||
vim.api.nvim_notify(vim.inspect(out), vim.log.levels.INFO, {}) | ||
end | ||
|
||
return { | ||
GetOldPlugins = GetOldPlugins | ||
} |