Linter fix

This commit is contained in:
Imbus 2024-12-04 06:35:14 +01:00
parent e9fe358191
commit c4e9f54a74

View file

@ -27,8 +27,12 @@ vim.api.nvim_create_autocmd('TextYankPost', {
vim.api.nvim_create_user_command('CDToGitRoot', function() vim.api.nvim_create_user_command('CDToGitRoot', function()
local handle = io.popen 'git rev-parse --show-toplevel 2>/dev/null' local handle = io.popen 'git rev-parse --show-toplevel 2>/dev/null'
local git_root = handle:read('*a'):gsub('\n', '') local git_root
handle:close()
if handle then
git_root = handle:read('*a'):gsub('\n', '')
handle:close()
end
if git_root == '' then if git_root == '' then
print 'Not in a Git repository' print 'Not in a Git repository'