BUGFIX: Don't try to start server when on main branch

This commit is contained in:
Harrison Cramer
2023-08-03 09:55:19 -04:00
parent b9538b1ce6
commit 74afe95d0e

View File

@@ -65,6 +65,13 @@ M.setup = function(args)
state.BASE_BRANCH = args.base_branch state.BASE_BRANCH = args.base_branch
end end
local current_branch_raw = io.popen("git rev-parse --abbrev-ref HEAD"):read("*a")
local current_branch = string.gsub(current_branch_raw, "\n", "")
if current_branch == state.BASE_BRANCH then
return
end
if u.is_gitlab_repo() then if u.is_gitlab_repo() then
state.PORT = args.port or 21036 state.PORT = args.port or 21036
vim.fn.jobstart(state.BIN .. " " .. state.PROJECT_ID .. " " .. state.PORT, { vim.fn.jobstart(state.BIN .. " " .. state.PROJECT_ID .. " " .. state.PORT, {