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 => Config -> IO (Maybe (Installed t))
- data GHC
- newtype CommandName = CommandName {}
- newtype CommandPath = CommandPath {}
- data Installed t = Installed {}
- tryFindVersion :: Config -> FilePath -> IO (Maybe Version)
- takeVersion :: String -> String
- tryFindVersionBy :: (String -> String) -> Config -> FilePath -> IO (Maybe Version)
- type Args = [String]
- tryRunOutput :: Config -> FilePath -> Args -> IO (Maybe String)
- tryRunLine :: Config -> FilePath -> Args -> IO (Maybe String)
- tryRun :: Config -> Tagged t CommandPath -> Args -> IO ExitCode
- tryRunErr :: String -> IO ExitCode -> IO ExitCode
- tryRunToFile :: Config -> FilePath -> Tagged t CommandPath -> Args -> IO ExitCode
- printDebug :: Config -> FilePath -> Args -> IO ()
- (.&&.) :: 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 :: Config -> 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 :: Config -> 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 :: Config -> FilePath -> Args -> IO (Maybe String) Source #
Only return the stdout if the process was successful and had no stderr.
tryRunLine :: Config -> FilePath -> Args -> IO (Maybe String) Source #
As with tryRunOutput
but only return the first line (if any).
tryRunErr :: String -> IO ExitCode -> IO ExitCode Source #
Print the error message if it isn't successful.
tryRunToFile :: Config -> FilePath -> Tagged t CommandPath -> Args -> IO ExitCode Source #