Releases: formwork-io/iron
v0.8.4
v0.8.3
v0.8.2
Summary
Adds the functions in-path and not-in-path along with their verbose variants vin-path and vnot-in-path.
Functions
in-path
Checks the argument exists in PATH.
Example
Check for user's home bin in PATH:
if in-path ${HOME}/bin; then
echo "PATH contains ${HOME}/bin."
fi
not-in-path
Checks the argument does not exist in PATH.
Example
Check for user's home bin in PATH:
if not-in-path ${HOME}/bin; then
echo "PATH does not contain ${HOME}/bin."
fi
v0.8.1
v0.8
Summary
Adds the functions append and prepend along with their verbose variants vappend and vprepend.
Functions
append
Appends to an existing variable; creating it if necessary.
Example
Append user's home bin to PATH:
append $(HOME)/bin PATH
prepend
Prepends to an existing variable; creating it if necessary.
Example
Prepend user's home bin to PATH:
prepend $(HOME)/bin PATH
v0.7
v0.6
v0.5
Summary
Renames exposed function _ with - characters, adds -or-die function variants, and adds internal _g_ functions.
Function Renaming
assert-env replaces assert_env
prompt-env replaces prompt_env
assert-source replaces assert_source
require-cmd replaces ``require_cmd use-gosh-contrib` replaces `use_gosh_contrib`
Or-Die Function Variants
The common || exit 1 idiom shown here:
require-cmd "realpath" || exit 1Gets simplified further by using its -or-die variant:
require-cmd-or-die "realpath"Or-die variants exist for all functions where the || exit 1 idiom is typically used.
Internal Functions
A suite of internal functions were added. These functions are prefixed with _g_ and are designed for use by formwork-io/gosh and formwork-io/gosh-contrib scripts.
v0.4
Summary
Adds support for formwork-io/gosh-contrib.
gosh-contrib
Use
Set GOSH_CONTRIB to a path containing .sh files. Scripts invoking use_gosh_contrib will have access to the variables and functions contained in those files. See the relevant example script for details.