Skip to content

Commit

Permalink
feat(nvim): Pipe README update script output to vim.notify.
Browse files Browse the repository at this point in the history
  • Loading branch information
chevcast committed Jan 1, 2025
1 parent fb6612c commit c159480
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion nvim/lua/plugins/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@ return {
vim.api.nvim_create_autocmd("User", {
pattern = "LazySync",
callback = function()
os.execute("bun $HOME/.dotfiles/update-readme.ts")
local handle = io.popen("bun $HOME/.dotfiles/update-readme.ts")
if handle then
local result = handle:read("*a")
handle:close()
if result then
vim.notify(result, vim.log.levels.INFO)
else
vim.notify("Failed to read output from command", vim.log.levels.ERROR)
end
else
vim.notify("Failed to execute command", vim.log.levels.ERROR)
end
end,
})
end,
Expand Down

0 comments on commit c159480

Please sign in to comment.