mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 22:16:34 +01:00
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:
parent
ad49ee756b
commit
f93d491a08
1 changed files with 8 additions and 12 deletions
|
@ -858,19 +858,15 @@ echo ""
|
|||
|
||||
fi # dialog
|
||||
|
||||
# See if tput is available, and use it if it is.
|
||||
if [ -n "$TPUT" ]; then
|
||||
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
|
||||
if [ -z "$PASTEBIN" ]; then
|
||||
FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2)
|
||||
else
|
||||
if [[ -z $PASTEBIN ]]; then
|
||||
FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2)
|
||||
else
|
||||
FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p')
|
||||
fi
|
||||
FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p')
|
||||
fi
|
||||
|
||||
# See if tput is available, and use it if it is.
|
||||
if [ -x "$TPUT" ]; then
|
||||
FINAL_URL=$(tput setaf 1; printf '%s' "$FINAL_URL"; tput sgr0)
|
||||
fi
|
||||
|
||||
# Output the URL of the uploaded file.
|
||||
|
|
Loading…
Reference in a new issue