Home

Awesome

Buava

The utility library for Bash you always dreamed of.

Project Status
Build status

Table of Contents

Quickstart

Take a look at the script located in lib directory like utils.sh.

Table of buava functions

This table shows a incomplete list of functions available in Buava:

Function nameDescription
check_not_nullRaise an error if variable is null
echoerrPrint on stderr
diePrint a stderr message and terminate with status 1
die_on_statusPrint a stderr message and terminate with the given status code
errorPrint an error in stderr
warnPrint a warn in stderr
infoPrint an info in stdout
bold_whiteChange color
bold_cyanChange color
bold_cyanChange color
bold_redChange color
normalChange color
askAsk a question to answer Yes/No
chooseChoose between multiple option
contains_element Check if element is in an array
inputTake a free form input
check_and_trapBefore trap signal check whether the trap already exists
check_and_force_trapBefore trap signal warn if the trap already exists
applyIdempotent apply a message in a file
is_appliedCheck if the message has been applied in a file
unapplyIdempotent unapply a message in a file
linkIdempotent link a configuration file to a well-known program (i.e. vim, emacs, and many others)
unlinkIdempotent unlink a configuration file to a well-known program
link_toIdempotent symlink from a source to a destination
check_linkCheck symlink
unlink_fromIdempotent unlink a symlink from source to a destination
downloadFlexible and resilient download function
install_or_update_vim_plugin_git_repoIdempotent management of vim plugins
install_or_update_git_repoIdempotent management of git repos
setup_configurationFlexible setup for configurations
backupKeep efficiently a number of backups for a given file
deleteIdempotent delete for files and directories
osx_detectTrue whether the platform is OSX

Troubleshooting

This section has been left blank intentionally. It will be filled up as soon as troubles come in!

Contributing

You could help improving Buava in the following ways: