Merge pull request #26 from kdheepak/bug/support-fish-shell
Support fish shell
This commit is contained in:
@@ -18,6 +18,11 @@ end
|
|||||||
|
|
||||||
--- Get project_root_dir for git repository
|
--- Get project_root_dir for git repository
|
||||||
local function project_root_dir()
|
local function project_root_dir()
|
||||||
|
|
||||||
|
-- always use bash
|
||||||
|
local oldshell = vim.o.shell
|
||||||
|
vim.o.shell = 'bash'
|
||||||
|
|
||||||
-- try submodule first
|
-- try submodule first
|
||||||
local gitdir = fn.system('cd "' .. fn.expand('%:p:h') .. '" && git rev-parse --show-superproject-working-tree')
|
local gitdir = fn.system('cd "' .. fn.expand('%:p:h') .. '" && git rev-parse --show-superproject-working-tree')
|
||||||
if gitdir ~= "" then
|
if gitdir ~= "" then
|
||||||
@@ -38,6 +43,9 @@ local function project_root_dir()
|
|||||||
return trim(gitdir)
|
return trim(gitdir)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- revert to old shell
|
||||||
|
vim.o.shell = oldshell
|
||||||
|
|
||||||
-- just return current working directory
|
-- just return current working directory
|
||||||
return fn.getcwd(0, 0)
|
return fn.getcwd(0, 0)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user