From 240ec24e4be7d10d6f1e3e723f217a612f11d2f3 Mon Sep 17 00:00:00 2001 From: James Tomasino Date: Wed, 15 Aug 2018 20:46:35 -0400 Subject: [PATCH] without -c, remove extra labels --- pb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pb b/pb index c80b885..b971c06 100755 --- a/pb +++ b/pb @@ -43,7 +43,11 @@ die () { if [ "${code}" -eq 0 ]; then printf "%s\\n" "${msg}" else - printf "%s%s%s\\n" "$ERROR" "${msg}" "$RESET" >&2 + if [ ${flag_colors} -gt 0 ]; then + printf "%s%s%s\\n" "$ERROR" "${msg}" "$RESET" >&2 + else + printf "%s\\n" "${msg}" >&2 + fi fi fi exit "${code}" @@ -139,12 +143,12 @@ if [ ${flag_file} -gt 0 ]; then fi if [ ${flag_colors} -gt 0 ]; then printf "%s%s\\t%s" "$RESET" "${f}" "$SUCCESS" - else - printf "%s\\t" "${f}" fi if [ -f "${f}" ]; then curl -F"file=@${f}" "${ENDPOINT}" - printf "%s" "$RESET" + if [ ${flag_colors} -gt 0 ]; then + printf "%s" "$RESET" + fi else if [ ${flag_colors} -gt 0 ]; then printf "%sFile not found.%s\\n" "$ERROR" "$RESET"