@@ -13,6 +13,8 @@ module Obelisk.CLI.Process
1313 , callProcessAndLogOutput
1414 , createProcess
1515 , createProcess_
16+ , callProcess
17+ , callCommand
1618 ) where
1719
1820import Control.Applicative (liftA2)
@@ -81,6 +83,21 @@ createProcess_ name p = do
8183 putLog Debug $ "Creating process " <> T.pack name <> ": " <> T.pack (show p)
8284 liftIO $ Process.createProcess p
8385
86+-- | Like `System.Process.callProcess` but also logs (debug) the process being run
87+callProcess
88+ :: (MonadIO m, MonadLog Output m)
89+ => String -> [String] -> m ()
90+callProcess exe args = do
91+ putLog Debug $ "Calling process " <> T.pack exe <> " with args: " <> T.pack (show args)
92+ liftIO $ Process.callProcess exe args
93+
94+-- | Like `System.Process.callCommand` but also logs (debug) the command being run
95+callCommand
96+ :: (MonadIO m, MonadLog Output m)
97+ => String -> m ()
98+callCommand cmd = do
99+ putLog Debug $ "Calling command " <> T.pack cmd
100+ liftIO $ Process.callCommand cmd
84101
85102withProcess
86103 :: (MonadIO m, MonadMask m, MonadLog Output m)