diff options
author | Fabian Kirchner <kirchner@posteo.de> | 2023-10-13 22:20:18 +0200 |
---|---|---|
committer | Fabian Kirchner <kirchner@posteo.de> | 2023-10-13 22:20:18 +0200 |
commit | 51663eab50cbc51a5786c0d55f21de62e9b15c0a (patch) | |
tree | cca6f3b4cfe39f89d62370fe425dea43b1107622 /app/Main.hs | |
parent | a0c72a80fbfed8e0963edff17ab5d52d2e3abd5b (diff) |
extract quote to Process and fix quoting quotes
Diffstat (limited to 'app/Main.hs')
-rw-r--r-- | app/Main.hs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/app/Main.hs b/app/Main.hs index bfe634c..9e838c8 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -88,7 +88,7 @@ import Options.Applicative ((<**>)) import Options.Applicative qualified as O import Prettyprinter qualified as P import Prettyprinter.Render.Terminal qualified as P -import Process (sh, sh_) +import Process (sh, sh_, quote) import System.Exit (ExitCode (ExitFailure), exitWith) import System.FilePath qualified as F import System.Process.Typed qualified as P @@ -316,11 +316,3 @@ getFiles files = ) ) ) - where - -quote :: String -> String -quote s = "'" ++ escape s ++ "'" - where - escape [] = [] - escape ('\'' : cs) = '\\' : '\'' : escape cs - escape (c : cs) = c : escape cs |