Skip to content

Commit 10373cd

Browse files
author
Johnny Le
committed
fix(actions): address review - reorder powershell to take priority on windows
1 parent d9141e1 commit 10373cd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lua/gitlinker/actions.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ end
1212
local function system(url)
1313
if vim.fn.has("mac") > 0 then
1414
vim.fn.jobstart({ "open", url })
15+
elseif vim.fn.executable("powershell.exe") > 0 then
16+
vim.fn.jobstart({ "powershell.exe", "-Command", "Start-Process", url })
1517
elseif vim.fn.has("win32") > 0 or vim.fn.has("win64") > 0 then
16-
vim.fn.jobstart({ "cmd", "/C", "start", url })
18+
if vim.fn.executable("powershell.exe") > 0 then
19+
vim.fn.jobstart({ "powershell.exe", "-Command", "Start-Process", url })
20+
else
21+
vim.fn.jobstart({ "cmd", "/C", "start", url })
22+
end
1723
elseif vim.fn.executable("wslview") > 0 then
1824
vim.fn.jobstart({ "wslview", url })
19-
elseif vim.fn.executable("powershell.exe") > 0 then
20-
vim.fn.jobstart({ "powershell.exe", "-Command", "Start-Process", url })
2125
else
2226
vim.fn.jobstart({ "xdg-open", url })
2327
end

0 commit comments

Comments
 (0)