Safe Haskell | None |
---|
Utilities for turning statements into full scripts.
- script :: Annotation t => Statement t -> Builder
- script_sha1 :: forall t t'. (Annotation t, Annotation t') => ByteString -> Statement t -> Statement t' -> Builder
- tokenCheck :: ByteString -> Statement t -> Statement (Statements t t')
- mtokenCheck :: Monoid t => ByteString -> (Statement t -> t) -> Statement t -> Statement t
- tokenFGREPq :: ByteString -> Statement t
- sha1Check :: (Annotation t, Annotation t') => Statement t -> Statement (Statements t t')
- sha1 :: ByteString -> ByteString
- dance :: Statement t -> Annotated (Statements t t')
- noop :: Statement any
Documentation
script :: Annotation t => Statement t -> BuilderSource
Produce a script beginning with #!/bin/bash
and a safe set statement.
script_sha1 :: forall t t'. (Annotation t, Annotation t') => ByteString -> Statement t -> Statement t' -> BuilderSource
Produce a script beginning with #!/bin/bash
and some (optional)
documentation. Cause the script to be scanned for SHA-1 hash of the setup
(first statement argument) and main (second statement argument) before
running the safe set statement and running the second argument.
tokenCheck :: ByteString -> Statement t -> Statement (Statements t t')Source
Scan $0
for the token before running, producing a statement annotated
with the initial statement. This is a bit clumsy but is used internally.
mtokenCheck :: Monoid t => ByteString -> (Statement t -> t) -> Statement t -> Statement tSource
Scan $0
for the token before running, correctly producing monoidal
annotations. The function argument provides an annotation for the fgrep
check generated to search for the token. (const mempty
would be
appropriate in most cases.)
tokenFGREPq :: ByteString -> Statement tSource
sha1Check :: (Annotation t, Annotation t') => Statement t -> Statement (Statements t t')Source
Scan $0
the SHA1 of the statement before running.
sha1 :: ByteString -> ByteStringSource