Reverse 'echo >/dev/stderr' for '>/dev/stderr echo' according to @jpetazzo preference

This commit is contained in:
AJ Bowen
2017-10-29 15:55:08 +01:00
parent 5b95d6ee7f
commit 1d46898737
3 changed files with 11 additions and 11 deletions

View File

@@ -13,15 +13,15 @@ die() {
}
error() {
echo >/dev/stderr "[$(red ERROR)] $1"
>/dev/stderr echo "[$(red ERROR)] $1"
}
warning() {
echo >/dev/stderr "[$(yellow WARNING)] $1"
>/dev/stderr echo "[$(yellow WARNING)] $1"
}
info() {
echo >/dev/stderr "[$(green INFO)] $1"
>/dev/stderr echo "[$(green INFO)] $1"
}
# Print a full-width separator.
@@ -33,19 +33,19 @@ sep() {
fi
SEP=$(yes = | tr -d "\n" | head -c $(($COLUMNS - 1)))
if [ -z "$1" ]; then
echo >/dev/stderr $SEP
>/dev/stderr echo $SEP
else
MSGLEN=$(echo "$1" | wc -c)
if [ $(($MSGLEN + 4)) -gt $COLUMNS ]; then
echo >/dev/stderr "$SEP"
echo >/dev/stderr "$1"
echo >/dev/stderr "$SEP"
>/dev/stderr echo "$SEP"
>/dev/stderr echo "$1"
>/dev/stderr echo "$SEP"
else
LEFTLEN=$((($COLUMNS - $MSGLEN - 2) / 2))
RIGHTLEN=$(($COLUMNS - $MSGLEN - 2 - $LEFTLEN))
LEFTSEP=$(echo $SEP | head -c $LEFTLEN)
RIGHTSEP=$(echo $SEP | head -c $RIGHTLEN)
echo >/dev/stderr "$LEFTSEP $1 $RIGHTSEP"
>/dev/stderr echo "$LEFTSEP $1 $RIGHTSEP"
fi
fi
}

View File

@@ -72,10 +72,10 @@ _cmd_deploy() {
# wait until all hosts are reachable before trying to deploy
info "Trying to reach $TAG instances..."
while ! tag_is_reachable $TAG; do
echo >/dev/stderr -n "."
>/dev/stderr echo -n "."
sleep 2
done
echo >/dev/stderr ""
>/dev/stderr echo ""
sep "Deploying tag $TAG"
pssh -I tee /tmp/settings.yaml <$SETTINGS

View File

@@ -6,7 +6,7 @@ pssh() {
HOSTFILE="ips.txt"
[ -f $HOSTFILE ] || {
echo >/dev/stderr "No hostfile found at $HOSTFILE"
>/dev/stderr echo "No hostfile found at $HOSTFILE"
return
}