From f52d24618c6976b81b1e7b648043a818d77a4869 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 26 May 2020 19:32:46 +0200 Subject: [PATCH] create prints.sh --- cleanup.sh | 1 + prepare.sh | 2 +- prints.sh | 37 +++++++++++++++++++++++++++++++++++++ utils.sh | 1 + 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 prints.sh diff --git a/cleanup.sh b/cleanup.sh index d87a08a..858570a 100755 --- a/cleanup.sh +++ b/cleanup.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +source $current_dir/prints.sh source $current_dir/variables.sh # Get variables from variables. info "Deleting container $CONTAINER_ID" diff --git a/prepare.sh b/prepare.sh index dae0c91..e7d6f2c 100755 --- a/prepare.sh +++ b/prepare.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source $current_dir/base.sh # Get variables from base. +source $current_dir/prints.sh source $current_dir/utils.sh # Get utils functions. set -eo pipefail diff --git a/prints.sh b/prints.sh new file mode 100755 index 0000000..8bce3a7 --- /dev/null +++ b/prints.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +readonly NORMAL=$(printf '\033[0m') +readonly BOLD=$(printf '\033[1m') +readonly faint=$(printf '\033[2m') +readonly UNDERLINE=$(printf '\033[4m') +readonly NEGATIVE=$(printf '\033[7m') +readonly RED=$(printf '\033[31m') +readonly GREEN=$(printf '\033[32m') +readonly ORANGE=$(printf '\033[33m') +readonly BLUE=$(printf '\033[34m') +readonly YELLOW=$(printf '\033[93m') +readonly WHITE=$(printf '\033[39m') + +function success() +{ + local msg=${1} + echo "[${BOLD}${GREEN} OK ${NORMAL}] ${msg}" +} + +function info() +{ + local msg=${1} + echo "[${BOLD}${BLUE}INFO${NORMAL}] ${msg}" +} + +function warn() +{ + local msg=${1} + echo "[${BOLD}${ORANGE}WARN${NORMAL}] ${msg}" 2>&1 +} + +function error() +{ + local msg=${1} + echo "[${BOLD}${RED}FAIL${NORMAL}] ${msg}" 2>&1 +} \ No newline at end of file diff --git a/utils.sh b/utils.sh index 0f7f18a..14a0242 100755 --- a/utils.sh +++ b/utils.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +source $current_dir/prints.sh source $current_dir/variables.sh # Get variables from variables. clean_containers()