Copyright | (c) Ivan Lazar Miljenovic |
---|---|
License | MIT |
Maintainer | Ivan.Miljenovic@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
- class Tool t where
- commandPath :: Tool t => IO (Maybe (Tagged t CommandPath))
- commandInformation :: Tool t => IO (Maybe (Installed t))
- data GHC
- newtype CommandName = CommandName {}
- newtype CommandPath = CommandPath {}
- data Installed t = Installed {}
- tryFindVersion :: FilePath -> IO (Maybe Version)
- takeVersion :: String -> String
- tryFindVersionBy :: (String -> String) -> FilePath -> IO (Maybe Version)
- type Args = [String]
- tryRunOutput :: FilePath -> Args -> IO (Maybe String)
- tryRunLine :: FilePath -> Args -> IO (Maybe String)
- tryRun :: Tagged t CommandPath -> Args -> IO ExitCode
- tryRunToFile :: FilePath -> Tagged t CommandPath -> Args -> IO ExitCode
- tryRunAll :: [Args] -> Tagged t CommandPath -> IO ExitCode
- (.&&.) :: Monad m => m ExitCode -> m ExitCode -> m ExitCode
- (.||.) :: Monad m => m ExitCode -> m ExitCode -> m ExitCode
- tryCommand :: String -> IO ExitCode -> IO ExitCode -> IO ExitCode
- makeBox :: String -> String
- allSuccess :: (Monad m, Foldable t) => t (m ExitCode) -> m ExitCode
- allM :: Monad m => (a -> m Bool) -> [a] -> m Bool
Documentation
commandName :: Tagged t CommandName Source #
commandVersion :: Tagged t CommandPath -> IO (Maybe (Tagged t Version)) Source #
commandPath :: Tool t => IO (Maybe (Tagged t CommandPath)) Source #
newtype CommandName Source #
newtype CommandPath Source #
tryFindVersion :: FilePath -> IO (Maybe Version) Source #
Attempt to find the version of the provided command, by assuming
it's contained in the first line of the output of command
--version
.
takeVersion :: String -> String Source #
If we're at the start of a Version, take all of it.
tryRunOutput :: FilePath -> Args -> IO (Maybe String) Source #
Only return the stdout if the process was successful and had no stderr.
tryRunLine :: FilePath -> Args -> IO (Maybe String) Source #
As with tryRunOutput
but only return the first line (if any).
tryRunToFile :: FilePath -> Tagged t CommandPath -> Args -> IO ExitCode Source #