-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.nvim.lua
19 lines (18 loc) · 835 Bytes
/
.nvim.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function BircleUpdate()
vim.ui.input({ prompt = "New Version No " }, function (input)
local parts = vim.split(input, "%.")
local major = parts[1]
local minor = parts[2]
local bug = parts[3]
local bug_extra_parts = vim.split(bug, "_")
bug = bug_extra_parts[1]
local extra = bug_extra_parts[2] or ""
local line_of_code = "const VERSION = { major: " .. major .. ", minor: " .. minor .. ", bug: " .. bug .. ", part: \"" .. extra .. "\", beta: false, alpha: false }"
vim.cmd[[:edit src/common.ts]]
vim.cmd("g/^const VERSION.*/norm cc" .. line_of_code)
vim.cmd[[:w]]
vim.system({"./make-changelog", input}):wait()
vim.cmd.term("git push origin main")
end)
end
vim.api.nvim_create_user_command("BircleUpdate", BircleUpdate, { })