packages feed

bein-0.3: Bein/ShellScripting.hs

module Bein.ShellScripting where

import System.Exit (ExitCode(..))
import System.Process (system)

systemM :: String -> IO ()
systemM cmd = do e <- system cmd
                 case e of
                   ExitSuccess -> return ()
                   ExitFailure v -> fail $ "Command '" ++ cmd ++ 
                                    "' exited with code " ++ show v
                   
systemM_ :: String -> IO ()
systemM_ cmd = system cmd >> return ()