style(sed): avoid backslash in insert option

- simpler and more readable
- https://unix.stackexchange.com/a/99351
This commit is contained in:
Ming Di Leom 2022-12-17 00:24:51 +00:00
parent b9eb33b743
commit f05ffe7f9c
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 3 additions and 3 deletions

View File

@ -49,20 +49,20 @@ mkdir -p "../public/"
# Original data
cat "tracking-url.txt" | \
sed '1 i\'"$COMMENT_UBO"'' | \
sed "1i $COMMENT_UBO" | \
sed "s/^!/#/g" > "../public/tracking-data.txt"
# uBO & Adguard
cat "tracking-url.txt" | \
sed "s/^/||/g" | \
sed "s/$/\$all/g" | \
sed '1 i\'"$COMMENT_UBO"'' > "../public/tracking-filter.txt"
sed "1i $COMMENT_UBO" > "../public/tracking-filter.txt"
# Vivaldi
cat "tracking-url.txt" | \
sed "s/^/||/g" | \
sed "s/$/\$script/g" | \
sed '1 i\'"$COMMENT_UBO"'' | \
sed "1i $COMMENT_UBO" | \
sed "1s/Blocklist/Blocklist (Vivaldi)/" > "../public/tracking-filter-vivaldi.txt"
## This took more than 10 minutes on my not-so-sham laptop which is equivalent of *forever* on puny CI/CD VM.