aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/dev/scripts/util.sh
diff options
context:
space:
mode:
authorRafael Matias <rafael@skyle.net>2019-06-04 21:35:36 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-06-04 21:35:36 +0800
commit42b81f94adba9aae7f7727951f35e92184b1eedb (patch)
tree73f3004ba6cd922bc54579fe886a7b3cb1df1741 /swarm/dev/scripts/util.sh
parent15f24ff1896835e6ab908b0d17c1cc36b300c408 (diff)
downloadgo-tangerine-42b81f94adba9aae7f7727951f35e92184b1eedb.tar
go-tangerine-42b81f94adba9aae7f7727951f35e92184b1eedb.tar.gz
go-tangerine-42b81f94adba9aae7f7727951f35e92184b1eedb.tar.bz2
go-tangerine-42b81f94adba9aae7f7727951f35e92184b1eedb.tar.lz
go-tangerine-42b81f94adba9aae7f7727951f35e92184b1eedb.tar.xz
go-tangerine-42b81f94adba9aae7f7727951f35e92184b1eedb.tar.zst
go-tangerine-42b81f94adba9aae7f7727951f35e92184b1eedb.zip
swarm: code cleanup, move to ethersphere/swarm (#19661)
Diffstat (limited to 'swarm/dev/scripts/util.sh')
-rw-r--r--swarm/dev/scripts/util.sh53
1 files changed, 0 insertions, 53 deletions
diff --git a/swarm/dev/scripts/util.sh b/swarm/dev/scripts/util.sh
deleted file mode 100644
index f17a12e42..000000000
--- a/swarm/dev/scripts/util.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-# shared shell functions
-
-info() {
- local msg="$@"
- local timestamp="$(date +%H:%M:%S)"
- say "===> ${timestamp} ${msg}" "green"
-}
-
-warn() {
- local msg="$@"
- local timestamp=$(date +%H:%M:%S)
- say "===> ${timestamp} WARN: ${msg}" "yellow" >&2
-}
-
-fail() {
- local msg="$@"
- say "ERROR: ${msg}" "red" >&2
- exit 1
-}
-
-# say prints the given message to STDOUT, using the optional color if
-# STDOUT is a terminal.
-#
-# usage:
-#
-# say "foo" - prints "foo"
-# say "bar" "red" - prints "bar" in red
-# say "baz" "green" - prints "baz" in green
-# say "qux" "red" | tee - prints "qux" with no colour
-#
-say() {
- local msg=$1
- local color=$2
-
- if [[ -n "${color}" ]] && [[ -t 1 ]]; then
- case "${color}" in
- red)
- echo -e "\033[1;31m${msg}\033[0m"
- ;;
- green)
- echo -e "\033[1;32m${msg}\033[0m"
- ;;
- yellow)
- echo -e "\033[1;33m${msg}\033[0m"
- ;;
- *)
- echo "${msg}"
- ;;
- esac
- else
- echo "${msg}"
- fi
-}