A collection of:
- bash libraries
- and documentation generation script to create bash script.
After installation, you would use the bashlib-echo.sh library and output an error:
source bashlib-echo.sh echo::err "Oups"
After installation, you would use the bashlib-error.sh library and shows a stack trace if any error with:
set -Eeuo pipefail source bashlib-error.sh error::set_trap
See each library documentation page for usage.
The bash-lib package contains the following libraries:
- bashlib-array.sh - Array functions (join, ...)
- bashlib-bash.sh - Bash functions (is interactive, trap, ...)
- bashlib-cd.sh - Cd functions
- bashlib-command.sh - Command functions (eval, ...)
- bashlib-crypto.sh - Cryptographic functions (Key, Cert, ...)
- bashlib-doc.sh - Documentation functions
- bashlib-echo.sh - Echo functions (info, warning, error, tip, ...)
- bashlib-error.sh - Error handler functions
- bashlib-git.sh - Git functions
- bashlib-linux.sh - Linux functions
- bashlib-path.sh - File System Path functions
- bashlib-script.sh - Script functions (ie source)
- bashlib-ssh.sh - Ssh functions
- bashlib-stack.sh - CallStack/Frame functions
- bashlib-string.sh - String functions
- bashlib-template.sh - Template functions
- bashlib-vault.sh - Retrieve secret from vault (hashicorp or pass)
source bashlib-[name].sh # to load the echo library source bashlib-echo.sh
- direnv-ext - Direnv Express - A direnv extension to get secret from vault
- dock-x - Dock Express - Your docker command driven by environment variables
- git-x - Git Express - Command plugin/extensions (back up Github, execute a command against multiple repositories, ...)
- kube-x - Kube Express - a framework to provision and manage a kubernetes cluster
- ssh-x - SSH Express - a framework to manage SSH connection
brew install --HEAD gerardnico/tap/bashlib
git clone https://github.com/gerardnico/bash-lib # Add the libraries and script directory into your path in your `.bashrc` file export PATH=$PWD/bash-lib/lib:$PATH export PATH=$PWD/bash-lib/bin:$PATH
This package get also the following scripts:
- bashlib-docgen - Generate the documentation of bash scripts and libraries
See dev
BASHLIB_LIBRARY_PATH is the directory of the libraries. It's optional if the library are in a directory
that is in the PATH environment variable.