readwwwlog: Don't open terminal if already in terminal
This commit is contained in:
parent
cf6d630911
commit
837077ea39
|
@ -30,8 +30,13 @@ for url in ${urls}; do
|
|||
sleep 1 # dpaste.com workaround
|
||||
local file="$(mktemp --suffix='.readwwwlog')"
|
||||
curl --silent --location --output ${file} ${url}
|
||||
${TERMINAL} ${termopts} -e \
|
||||
less --LINE-NUMBERS --pattern='(error|fail):' ${file}
|
||||
|
||||
local -a cmd=(less --LINE-NUMBERS --pattern='(error|fail):' ${file})
|
||||
if [[ -o NO_INTERACTIVE ]]; then
|
||||
cmd=(${TERMINAL} ${termopts} -e ${cmd})
|
||||
fi
|
||||
${cmd}
|
||||
|
||||
rm ${file}
|
||||
else
|
||||
${default_cmd} ${url}
|
||||
|
|
Loading…
Reference in New Issue
Block a user