Modified project_id logic to require .gitlab.nvim file

This commit is contained in:
Harrison Cramer
2023-05-19 18:20:16 -07:00
parent ca7c702fd0
commit 27ec4668c1
4 changed files with 13 additions and 20 deletions

View File

@@ -60,13 +60,14 @@ M.setup = function(args, build_only)
if build_only then return end
-- Override project_id in setup call if configuration file is present
local config_file_path = vim.fn.getcwd() .. "/.gitlab.nvim"
local config_file_content = u.read_file(config_file_path)
if config_file_content ~= nil then
args.project_id = config_file_content
if config_file_content == nil then
return
end
args.project_id = config_file_content
if args.project_id == nil then
args.project_id = u.read_file(state.BIN_PATH .. "/.gitlab/project_id")
error("No project ID provided!")