De-refactor the output function in scripts

This commit is contained in:
Nestor Soriano 2020-10-06 09:36:18 +02:00
parent 69b32246c1
commit 62aaa3f73a
3 changed files with 28 additions and 25 deletions

View File

@ -1,21 +0,0 @@
#!/bin/sh
# Output colorized strings.
#
# Usage:
#
# . $(dirname "$0")/output.sh
# output <color> "Foobar"
#
# Color codes:
# 0 - black
# 1 - red
# 2 - green
# 3 - yellow
# 4 - blue
# 5 - magenta
# 6 - cian
# 7 - white
output() {
echo "$(tput setaf "$1")$2$(tput sgr0)"
}

View File

@ -1,7 +1,19 @@
#!/bin/sh
# See output.sh for an explanation of the available color codes.
. $(dirname "$0")/output.sh
# Output colorized strings
#
# Color codes:
# 0 - black
# 1 - red
# 2 - green
# 3 - yellow
# 4 - blue
# 5 - magenta
# 6 - cian
# 7 - white
output() {
echo "$(tput setaf "$1")$2$(tput sgr0)"
}
if [ ! -d "packages/" ]; then
output 1 "./packages doesn't exist!"

View File

@ -1,7 +1,19 @@
#!/bin/sh
# See output.sh for an explanation of available the color codes.
. $(dirname "$0")/output.sh
# Output colorized strings
#
# Color codes:
# 0 - black
# 1 - red
# 2 - green
# 3 - yellow
# 4 - blue
# 5 - magenta
# 6 - cian
# 7 - white
output() {
echo "$(tput setaf "$1")$2$(tput sgr0)"
}
output 6 "Prefixing the appropriate vendor namespaces with Automattic\WooCommerce\Vendor"