tempered/src/Plated/Command.hs
2017-04-20 18:28:16 -06:00

19 lines
406 B
Haskell

module Plated.Command
( Command(..)
, interpCommand
) where
import System.Process (readCreateProcessWithExitCode, shell)
import qualified Data.Text as T
data Command =
Command T.Text
deriving Show
interpCommand :: T.Text -> Command -> IO T.Text
interpCommand inp (Command cmd) = do
(_, out, _) <- readCreateProcessWithExitCode (shell $ T.unpack cmd) (T.unpack inp)
return . T.pack $ out