Download:
child 214:805ab1671452
parent 212:05fdc9e2fb0f
213:48c311d68f60
Anton Shestakov <av6@dwimlabs.net>, Wed, 10 Aug 2016 01:26:39 +0800
updatesri: ignore egrep exit code (since we do set -e and pipefail)

1 файлов изменено, 2 вставок(+), 2 удалений(-) [+]
contrib/updatesri.sh file | annotate | diff | comparison | revisions
--- a/contrib/updatesri.sh Wed Aug 10 01:19:54 2016 +0800
+++ b/contrib/updatesri.sh Wed Aug 10 01:26:39 2016 +0800
@@ -2,12 +2,12 @@
set -euo pipefail
-egrep -oh 'https://[^"]+\.js' "$@" | sort -u | while read url; do
+( egrep -oh 'https://[^"]+\.js' "$@" || true ) | sort -u | while read url; do
hash=$(curl -fsS "$url" | openssl dgst -sha384 -binary | openssl base64 -A)
sed -i "\|$url| c\\ <script src=\"$url\" integrity=\"sha384-$hash\" crossorigin=\"anonymous\"></script>" "$@"
done
-egrep -oh 'https://[^"]+\.css' "$@" | sort -u | while read url; do
+( egrep -oh 'https://[^"]+\.css' "$@" || true ) | sort -u | while read url; do
hash=$(curl -fsS "$url" | openssl dgst -sha384 -binary | openssl base64 -A)
sed -i "\|$url| c\\ <link rel=\"stylesheet\" href=\"$url\" integrity=\"sha384-$hash\" crossorigin=\"anonymous\">" "$@"
done