fix tee running before jq reads the file

This commit is contained in:
askiiart 2025-02-23 14:06:31 -06:00
parent 0f07a70916
commit a2c4e9c104
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A

View file

@ -1,5 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
# install deps
apt update && apt install jq -y
npm install -g web-ext pnpm
git clone --depth 1 https://github.com/Vendicated/Vencord
@ -11,7 +14,13 @@ pnpm run buildWeb
# change id
cd ./dist/
jq '.browser_specific_settings.gecko.id = "vencord-firefox@askiiart.net"' ./firefox-unpacked/manifest.json >./firefox-unpacked/manifest.json
# can't just `tee` it directly into it, otherwise tee will erase all contents of the file, *then* jq will run
# (same for redirecting the output ofc)
tmpfile=$(mktemp)
jq '.browser_specific_settings.gecko.id = "vencord-firefox@askiiart.net"' ./firefox-unpacked/manifest.json -c >$tmpfile
mv $tmpfile ./firefox-unpacked/manifest.json
# build it to an extension or whatever idk
web-ext build -s ./firefox-unpacked/
# move to /misc and set version