From 65bfe621f312ea93ccc5938cf950edbcb3de600e Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Tue, 27 Sep 2022 19:20:24 +1000 Subject: [PATCH] add btinclude finction to output code for usage in scripts --- bashtools.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bashtools.sh b/bashtools.sh index 2cb6551..08edf0e 100755 --- a/bashtools.sh +++ b/bashtools.sh @@ -51,6 +51,14 @@ SPINNERFILE="$BASHTOOLS_DIR/spinner.pid" export REGEXP_IP='^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$' +function btinclude() { + echo '. ${HOME}/code/bashtools/bashtools.sh' + echo 'if [[ -z $HAVE_BASHTOOLS ]]; then' + echo ' echo "ERROR: bashtools not installed download from https://git.nethack.net/rob/bashtools" >/dev/stderr' + echo ' exit 1' + echo 'fi' +} + function ansi(){ export BOLD="\033[1m" export PLAIN="\033[0m"