Clone this repository to a host where you want to use the scripts. Add the root directory to the environment variable PATH
.
This repository employs bats as a testing framework for Bash scripts. bats core and libraries are included as submodules of this repository following the quick installation guide. Run the following command to install the latest version of bats.
git submodule update --init --recursive
You may run unit tests manually by the following command.
./test/run_tests
However, those unit tests are usually run automatically by a pre-commit hook, which is introduced in the next subsection.
This repository employs pre-commit to manage pre-commit hooks. Install pre-commit if you have not installed it on a host where this repository is cloned. Then, run the following command to install hooks.
pre-commit install
You may confirm confirm if pre-comment works appropriately by running the command below.
pre-commit run --all-files
trim trailing whitespace........................................Passed
fix end of files................................................Passed
check yaml......................................................Passed
check for added large files.....................................Passed
ShellCheck......................................................Passed
Bats............................................................Passed