-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepo.lua
More file actions
34 lines (28 loc) · 1005 Bytes
/
Copy pathrepo.lua
File metadata and controls
34 lines (28 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local M = {}
local ok, error = pcall(require, 'agitate.error')
if not ok then
return vim.api.nvim_err_writeln(require('agitate.const.error').import)
end
function M.setup()
vim.api.nvim_create_user_command('AgitateRepoCreateGitHub', function(opts)
local repo_ok, repo_or_err = pcall(require, 'agitate.core.repo')
if not repo_ok then
return error.throw(repo_or_err)
end
repo_or_err.CreateGitHubCurl(opts.fargs)
end, {
nargs = '*',
desc = "Creates a new repository at 'github.com/<github_username>/<argument or current_directory>/'",
})
vim.api.nvim_create_user_command('AgitateRepoInitGitHub', function(opts)
local repo_ok, repo_or_err = pcall(require, 'agitate.core.repo')
if not repo_ok then
return error.throw(repo_or_err)
end
repo_or_err.InitGitHub(opts.fargs)
end, {
nargs = '*',
desc = "Initialize the current directory as a repository at 'github.com/<github_username>/<argument or current_directory>/'",
})
end
return M