@@ -40,6 +40,7 @@ import System.IO (Handle)
4040import System.IO.Streams (InputStream, handleToInputStream)
4141import qualified System.IO.Streams as Streams
4242import System.IO.Streams.Concurrent (concurrentMerge)
43+import System.Posix.Escape (escape)
4344import System.Process (CreateProcess, ProcessHandle, StdStream (CreatePipe), cmdspec, std_err, std_out,
4445 waitForProcess)
4546import qualified System.Process as Process
@@ -182,5 +183,4 @@ reconstructCommand :: Process.CmdSpec -> Text
182183reconstructCommand (Process.ShellCommand str) = T.pack str
183184reconstructCommand (Process.RawCommand c as) = processToShellString c as
184185 where
185− processToShellString cmd args = T.unwords $ map quoteAndEscape (cmd : args)
186− quoteAndEscape x = "'" <> T.replace "'" "'\''" (T.pack x) <> "'"
186+ processToShellString cmd args = T.pack $ unwords $ map escape (cmd : args)