| Copyright | (c) 2019-2022 Kowainik |
|---|---|
| License | MPL-2.0 |
| Maintainer | Kowainik <xrom.xkov@gmail.com> |
| Stability | Stable |
| Portability | Portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Shellmet
Contents
Description
This module contains neat utilities to be able to work with shell commands in generic and simple way using just string literals.
>>>"echo" ["Hello", "World!"]⚙ echo Hello 'World!' Hello World!
Documentation
($|) :: FilePath -> [Text] -> IO Text infix 5 Source #
Run shell command with given options and return stripped stdout of the executed command.
>>>"echo" $| ["Foo", "Bar"]"Foo Bar"
($^) :: FilePath -> [Text] -> IO () infix 5 Source #
This operator runs shell command with given options but doesn't print the command itself.
>>>"echo" $^ ["Foo", "Bar"]Foo Bar
($?) :: IO a -> IO a -> IO a infixl 4 Source #
Do some IO actions when process failed with IOError.
>>>"echo" ["0"] $? putStrLn "Command failed"⚙ echo 0 0
>>>"exit" ["1"] $? putStrLn "Command failed"⚙ exit 1 Command failed
isSuccess :: IO a -> IO Bool Source #
Returns the indicator of if the command succeded or not.
>>>isSuccess $ "echo" ["Hello world!"]⚙ echo 'Hello world!' Hello world! True