Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

Releases: formwork-io/iron

v0.8.4

24 Nov 11:35

Choose a tag to compare

Summary

Adds the functions if-failed-die.

Functions

if-failed-die

Call exit if the previous command exit status is nonzero.

Example

result=$(exit 1)
if-failed-die
echo "This text will never be displayed."

v0.8.3

18 Nov 03:10

Choose a tag to compare

Summary

Adds the functions run-or-die and its verbose variant vrun-or-die.

Functions

run-or-die

Runs a command and exits if it fails. All output from the command is hidden unless it fails.

Example

run-or-die make

v0.8.2

20 Oct 22:43

Choose a tag to compare

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

07 Oct 21:23

Choose a tag to compare

Summary

Fix #9

v0.8

18 Sep 16:13

Choose a tag to compare

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

23 Jun 22:31

Choose a tag to compare

Summary

Adds the function override and its voverride variant.

Functions

override

Overrides a variable; setting it if not already set.

Example:

override foo bar

voverride

Verbose variant of override.

Example:

voverride foo bar

v0.6

11 Feb 02:29

Choose a tag to compare

Summary

Fix function call syntax in root env.sh.

v0.5

08 Feb 06:46

Choose a tag to compare

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 1

Gets 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

28 Jan 02:50

Choose a tag to compare

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.

v0.3

02 Jan 06:27

Choose a tag to compare

Summary

Adds the function require_cmd and the ! syntax.

Functions

require_cmd

Requires a command be found before continuing.

Example:

require_cmd realpath || exit 1

Syntax

!

Selects the previously chosen menu item.