check if we are up to date with remote repo

This commit is contained in:
2023-05-23 14:39:20 -04:00
parent 834f7ffaac
commit 7cf8bc3a4c
2 changed files with 17 additions and 0 deletions

View File

@ -35,6 +35,9 @@ local function configmenu()
if package.loaded['mason'] then
require('mason.api.command').MasonUpdate()
end
if choice == 'update config' then
require('mngr.updates')
end
if choice == 'show keybinds' then
require('telescope.builtin').keymaps()
end

View File

@ -0,0 +1,14 @@
-- janky popen madness to use curl without luarocks
local remoteCommit = io.popen([[curl -s https://git.squi.bid/nvim/commit/ | grep -o "<a href='/nvim/commit/?id=.*>" | cut -d "'" -f 2 | cut -d "=" -f 2 | head -1]])
local remoteResult = remoteCommit:read("*a")
remoteCommit:close()
local localCommit = io.popen([[cd $XDG_CONFIG_HOME/nvim; git log | head -1 | cut -d " " -f 2]])
local localResult = localCommit:read("*a")
localCommit:close()
if remoteResult ~= localResult then
vim.notify("Out of date with remote repo :(", vim.log.levels.WARN, {title = "Nvim Config"})
else
vim.notify("Up to date with remote repo :)", vim.log.levels.INFO, {title = "Nvim Config"})
end