Skip to content

Commit

Permalink
chore(api): user.update fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKJeff16 committed Jun 11, 2024
1 parent dd91c24 commit a1bae0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lua/user/types/user/update.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---@class User.Update
---@field update fun(...)
---@field new fun(): User.Update
---@field new? fun(): User.Update
---@field protected __index? User.Update
7 changes: 1 addition & 6 deletions lua/user/update.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,20 @@ function M.update(...)

local old_cwd = vim.fn.getcwd()

vim.cmd('cd ' .. vim.fn.stdpath('config'))

local cmd = {
'git',
'pull',
'--rebase',
'--recurse-submodules',
}

vim.fn.system(cmd)

vim.cmd('cd ' .. old_cwd)
vim.system(cmd, { cwd = vim.fn.stdpath('config') })
end

function M.new()
local self = setmetatable({}, { __index = M, __call = M.update })

self.update = M.update
self.new = M.new

return self
end
Expand Down

0 comments on commit a1bae0c

Please sign in to comment.