hgraca / bash-overlay
A bash library with utility functions.
v0.2.3
2023-08-07 12:14 UTC
Requires
Requires (Dev)
- ergebnis/composer-normalize: ^2.34
- hgraca/shunit: ^0.1
README
A library of domain agnostic Bash functions, with clear names, which can be reused across projects as if they were part of Bash itself.
Hopefully, this will make it simpler to create new Bash scripts, and it will make them more readable.
How to use
You can install this library in your project, using composer.
Once you have composer installed in your system, you can run composer install
,
which will install all dependencies and generate the autoloader in vendor/autoload.sh
.
Include the file vendor/autoload.sh
in your script, and you are good to go.
Ex:
#!/usr/bin/env bash
. "./vendor/autoload.sh" # Make sure the path is correct
if os.is_ubuntu; then
echo "Is Ubuntu!"
elif os.is_alpine; then
echo "Is Alpine!"
else
echo "Unknown distribution"
fi
Running the tests
You can run the tests by running composer test
.