chore: run fmt, and lint

This commit is contained in:
Ali Almohaya 2022-10-10 01:16:44 +03:00
parent f660c7b2b1
commit cec20701ae
No known key found for this signature in database
GPG key ID: 4B80BC43FC6007E0
2 changed files with 5 additions and 3 deletions

View file

@ -3,8 +3,8 @@ local M = {}
function M.setup()
-- get the current working directory and set the url
local current_buffer = vim.fn.expand('%:p:h')
local repo_url = vim.fn.system("git -C " ..current_buffer.. " config --get remote.origin.url" )
local current_buffer = vim.fn.expand("%:p:h")
local repo_url = vim.fn.system("git -C " .. current_buffer .. " config --get remote.origin.url")
if repo_url:len() == 0 then
M.is_no_git_origin = true

View file

@ -29,7 +29,9 @@ function M.parse_gh_remote(url)
local ssh = { string.find(url, ".*git@(.*)[:/]([^/]*)/([^%s/]*)") }
local matches = http[1] == nil and ssh or http
if matches[1] == nil then return nil end
if matches[1] == nil then
return nil
end
local _, _, host, user_or_org, reponame = unpack(matches)
return { host = host, user_or_org = user_or_org, reponame = string.gsub(reponame, ".git", "") }