TangoMan Bash Tools is an awesome collection of small useful shell scripts.
- Copy "tools" folder into your project.
- Source desired script in your own script.
source ./tools/src/colors/colors.sh
- Call desired function.
echo_info "Hello World !"
TangoMan Bash Tool provides the following features:
A semantic set of colors for shell scripts.
Try this in your script :
#!/bin/bash
CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/colors/colors.sh
echo_primary 'This is primary text (97m)'
echo_secondary 'This is secondary text (94m)'
echo_success 'This is a success (32m)'
echo_danger 'This is a danger (31m)'
echo_warning 'This is a warning (33m)'
echo_info 'This is an info (95m)'
echo_light 'This is light (47;90m)'
echo_dark 'This is dark (40;37m)'
echo
echo_label "${PADDING}" 'label (32m):'; echo_primary 'This is a label'
echo_error 'This is an error (31m)'
#!/bin/bash
CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/colors/colors.sh
alert_primary 'This is a primary alert (1;104;97m)'
alert_secondary 'This is a secondary alert (1;45;97m)'
alert_success 'This is a success alert (1;42;97m)'
alert_danger 'This is a danger alert (1;41;97m)'
alert_warning 'This is a warning alert (1;43;97m)'
alert_info 'This is a info alert (1;44;97m)'
alert_light 'This is a light alert (1;47;90m)'
alert_dark 'This is a dark alert (1;40;37m)'
If you want to use Symfony theme for alerts use this file instead: /tools/src/colors/colors_sf.sh
π NOTE:
- Version a is the same than default version without comments.
- Version b is the same than default version with line feed at the end of each string.
- Version c does not use variables (less clutter).
- Version d is the same than version c with line feed at the end of each string.
Get repository latest release from github.
Get repository latest tag from github.
Download file with either curl or wget.
This script is meant to quickly check for common apps installation.
Throws error when user doesn't own root privileges.
Check version of some development tools.
Compare two semantic versions.
Edit your local /etc/hosts
config from shell scripts.
Returns true when given application or command is available.
Returns true when current operating system runs one of ubuntu version.
Opens a user prompt for given value.
Updates GRUB on multiple patforms.
Read parameter from .yaml file.
Set parameter to .yaml file.
Just copy this folder into your project or import this repository into your git project as a submodule.
# with https
git submodule add https://github.com/TangoMan75/tools.git ./tools
# with ssh
git submodule add git@github.com:TangoMan75/tools.git ./tools
Place following snippet in your code.
#!/bin/bash
CURDIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/colors/colors.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/git/get_latest_release.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/git/get_latest_tag.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/network/download.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/check_install.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/check_root.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/check_versions.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/compare_versions.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/hosts.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/is_installed.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/is_root.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/is_ubuntu.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/prompt_user.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/system/update_grub.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/yaml/get_parameter.sh
# shellcheck source=/dev/null
. "${CURDIR}"/tools/src/yaml/set_parameter.sh
Thank you for your interest in contributing to TangoMan Bash Tools.
Please review the code of conduct and contribution guidelines before starting to work on any features.
If you want to open an issue, please check first if it was not reported already before creating a new one.
Copyrights (c) 2021 "Matthias Morin" <mat@tangoman.io>
Distributed under the MIT license.
If you like TangoMan Bash Tools please star, follow or tweet:
... And check my other cool projects.