Import all the libararies:
source /path/to/bash-utils/all.sh
Import single LIBRARY
:
source /path/to/bash-utils/lib/${LIBRARY}
Output styled message. See
chalk.sh
for further details and predinedchalk.<style>
shortcuts.
# chalk [<style>] [<message>]
# @param <style := $NO_COLOR> The style to apply to the <message>
# @param <message := ''> The message
chalk $YELLOW "Message in yellow color."
# chalk.<style> functions
chalk.RED "Message in red color."
Define ANSI color escape codes See
colors.sh
for further details and predefined colors.
# color <ansi_color_code>
# @param <ainsi_color_code> The ANSI color code
RED=$( color "0;31" )
Log a message with an appropriate colorized level See
log.sh
for further details and predefinedlog.<level>
shortcuts.
# log [<level>] [<message>]
# @param <level := ''> The log level
# @param <message := ''> The log message
log --info "Info message."
log.info "Info message."
Resolve the root path from a bash script. See
root_path.sh
for further details.
# root_path <source>
# @param <source> The bash source invokation
ROOT_PATH=$( root_path ${BASH_SOURCE[0]} )
See LICENSE
file