dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 01a603f56a95ed1e816ac9abfd540dc2a3b4bfd7
parent 63711d11d1dfadb87c690ba82361ee5d5cd32c65
Author: hhvn <dev@hhvn.uk>
Date:   Mon, 27 Sep 2021 17:45:46 +0100

.s/b/plumb: source mimetype from 200 reply only

Diffstat:
M.scripts/bin/plumb | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/.scripts/bin/plumb b/.scripts/bin/plumb @@ -93,10 +93,9 @@ fetch(){ } mime(){ - mime=$($proxy curl -i$([ "$verbose" != "y" ] && echo s) "$(echo "$arg" | sed -E 's/]|\[|}|\{/\\&/g')" | - awk '/HTTP/ && $2 != "200" {s=1}; /^[[:space:]]*$/ {if (s) s=0; else exit 1}; !s' | - tr '[:upper:]' '[:lower:]' | - awk '$1 == "content-type:" {print $2}') + mime=$($proxy curl -Li$([ "$verbose" != "y" ] && echo s) "$(echo "$arg" | sed -E 's/]|\[|}|\{/\\&/g')" | + awk '/^HTTP/ && $2 != "200" {s=1}; /^HTTP/ && $2 == "200" {p=1}; /^[[:space:]]*$/ {if (s) s=0; else exit 1}; p' | + tr '[:upper:]' '[:lower:]' | awk '$1 == "content-type:" {print $2}') echo "$mime" | tee /dev/stderr | grep -i "$1" >/dev/null }