jbi-0.1.0.0: Just Build It - a "do what I mean" abstraction for Haskell build tools

Copyright(c) Ivan Lazar Miljenovic
LicenseMIT
MaintainerIvan.Miljenovic@gmail.com
Safe HaskellNone
LanguageHaskell2010

System.JBI.Commands.Tool

Description

 

Synopsis

Documentation

data Installed t Source #

Constructors

Installed 

Fields

Instances

Eq (Installed t) Source # 

Methods

(==) :: Installed t -> Installed t -> Bool #

(/=) :: Installed t -> Installed t -> Bool #

Ord (Installed t) Source # 
Read (Installed t) Source # 
Show (Installed t) Source # 
Generic (Installed t) Source # 

Associated Types

type Rep (Installed t) :: * -> * #

Methods

from :: Installed t -> Rep (Installed t) x #

to :: Rep (Installed t) x -> Installed t #

ToJSON (Installed t) Source # 
type Rep (Installed t) Source # 
type Rep (Installed t) = D1 (MetaData "Installed" "System.JBI.Commands.Tool" "jbi-0.1.0.0-H3lqhY7ZSRMEKM0XTQQkPr" False) (C1 (MetaCons "Installed" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "path") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Tagged * t CommandPath))) (S1 (MetaSel (Just Symbol "version") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (Tagged * t Version))))))

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.

type Args = [String] Source #

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).

tryRun :: Tagged t CommandPath -> Args -> IO ExitCode Source #

Returns success of call.

tryRunAll :: [Args] -> Tagged t CommandPath -> IO ExitCode Source #

Equivalent to chaining all the calls with && in bash, etc.

Argument order to make it easier to feed it into a Tagged-based pipeline.

(.&&.) :: Monad m => m ExitCode -> m ExitCode -> m ExitCode infixr 3 Source #

(.||.) :: Monad m => m ExitCode -> m ExitCode -> m ExitCode infixr 2 Source #

allM :: Monad m => (a -> m Bool) -> [a] -> m Bool Source #

Monad version of all, aborts the computation at the first False value