File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ local M = {}
66M .verbose = true
77
88--- @param input_cmd string
9- --- @param execute_directly boolean
9+ --- @param execute_directly ? boolean
1010--- @return string | nil output
1111--- @return number exit_code
1212M .execute = function (input_cmd , execute_directly )
@@ -33,7 +33,7 @@ M.execute = function(input_cmd, execute_directly)
3333
3434 -- otherwise (linux, macos), execute the command directly
3535 else
36- cmd = input_cmd
36+ cmd = " sh -c " .. vim . fn . shellescape ( input_cmd )
3737 end
3838
3939 local output = vim .fn .system (cmd )
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ describe("util", function()
2525 local command = " command"
2626 local output , exit_code = util .execute (command )
2727
28- assert .equal (output , command )
28+ assert .equal (output , " sh -c ' command' " )
2929 assert .equal (exit_code , 0 )
3030 end )
3131
You can’t perform that action at this time.
0 commit comments