alsa-info.sh: Condense nested commands for formatting upload result

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
David Ward 2019-12-21 00:32:09 -05:00 committed by Takashi Iwai
parent ad49ee756b
commit f93d491a08

View file

@ -858,19 +858,15 @@ echo ""
fi # dialog fi # dialog
# See if tput is available, and use it if it is. if [ -z "$PASTEBIN" ]; then
if [ -n "$TPUT" ]; then FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2)
if [[ -z $PASTEBIN ]]; then
FINAL_URL=$(tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2 ; tput sgr0)
else
FINAL_URL=$(tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp | sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'; tput sgr0)
fi
else else
if [[ -z $PASTEBIN ]]; then FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p')
FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2) fi
else
FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p') # See if tput is available, and use it if it is.
fi if [ -x "$TPUT" ]; then
FINAL_URL=$(tput setaf 1; printf '%s' "$FINAL_URL"; tput sgr0)
fi fi
# Output the URL of the uploaded file. # Output the URL of the uploaded file.