Open
Description
Implement functions to run Shell commands easier in the Iris applications. A simple implementation would be something like this (inspired by shellmet
):
-- | Run the command but don't print it
shellSilent
:: FilePath -- ^ Executable name
-> [Text] -- ^ Arguments
-> IO ()
-- | Run the command and print the command itself to stderr
shell
:: Text -- ^ Prompt
-> FilePath -- ^ Executable name
-> [Text] -- ^ Arguments
-> IO ()
-- | Run the command, don't print it and return its stdout
shellRetSilent
:: FilePath -- ^ Executable name
-> [Text] -- ^ Arguments
-> IO Text
-- | Run the command, print it with prompt to stderr and return its stdout
shellRet
:: Text -- ^ Prompt
-> FilePath -- ^ Executable name
-> [Text] -- ^ Arguments
-> IO Text
Alternatively, we can integrate with one of the existing and battle-tested libraries:
Possible usage inside Iris itself — Iris.Browse
module:
Lines 69 to 74 in 7e69433
Open questions:
- Would it make sense to run those commands in
MonadReader CliEnv
to use something specific for running shell commands?