Contate parses files for arbitrarily placed shebang!s (#!
) and substitutes the script output into the document.
Remember to add the pre-push
script hook to .git/hooks if you're going to develop
It looks for
...Static content...
#!/bin/bash
echo "Some script output"
!#
...More static content...
And gives you:
...Static content...
Some script output
...More static content...
make all
will output the script to build/
, so build/contate
is the most recent version. Once it is running, it exports a function called "contate" to call itself, so it doesn't necessarily need to be in $PATH
.
Contate targets by default must have a .contate
ending and they will be output without it.
contate [OPTIONS] targets...
-r
.-o
to specify the output folder or -o -
for stdout (default) (SEE NOTE)-d
for dry run which skips actual file parsing.-q
is intended to silence all output-p
will replace the selection POSIX regex pattern. The default is: (.*).contate$
where the capture group is the output path (placed on-top of that specified by -o
)NOTE: Contate exports its options as env vars so contate-subprocesses can use them. Therefore, setting output explicitly to stdout when using contate
in *.contate
files is wise.
You are NOT limited to bash scripts.
You have inline bash scripts: #!$(command)!#
You can escape shebangs: ##!/this/is/static
The bash provides an env var which is a key->value list. From bash, you can use:
d_set key val
sets the key to vald_get key
echos the vald_exists key
exits normally if it exists, otherwise exit status 1d_del key
always succeedsAccess in more languages is coming.