feat(update): show updated addons only
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-04-13 00:25:10 -04:00
parent 29d5cf6844
commit 118fac38a8

View file

@ -40,16 +40,21 @@ updateFirefoxAddons() {
file=generated-firefox-addons.nix file=generated-firefox-addons.nix
if [[ -f $file ]]; then if [[ -f $file ]]; then
printf "\nOld versions: \n" readarray -t OLD_VERS <<< "$(grep -A 1 --no-group-separator 'pname' "$file" |
grep -A 1 --no-group-separator 'pname' "$file" |
awk '{ gsub(/"/, ""); gsub(/;/, ""); print $3 }' | awk '{ gsub(/"/, ""); gsub(/;/, ""); print $3 }' |
awk 'NR%2{printf $0" version ";next;}1' | paste -sd'\n' - awk 'NR%2{printf $0" version ";next;}1' | paste -sd'\n' -)"
printf "\nNew versions: \n" readarray -t NEW_VERS <<< "$(sed 's/Fetched //' <(mozilla-addons-to-nix addons.json generated-firefox-addons.nix) |
sort)"
for (( i=0; i<${#OLD_VERS[@]}; i++ )); do
if [[ "${OLD_VERS[$i]}" != "${NEW_VERS[$i]}" ]]; then
echo "${OLD_VERS[$i]} -> $(echo "${NEW_VERS[$i]}" | awk '{print $NF}')"
fi fi
done
else
mozilla-addons-to-nix addons.json generated-firefox-addons.nix mozilla-addons-to-nix addons.json generated-firefox-addons.nix
fi
) )
} }
@ -94,4 +99,4 @@ doAllWithoutDocker() {
[[ "$1" == "-ffz" || "$1" == "--frankerfacez" ]] && updateFFZ [[ "$1" == "-ffz" || "$1" == "--frankerfacez" ]] && updateFFZ
[[ "$1" == "-v" || "$1" == "--vuetorrent" ]] && updateVuetorrent [[ "$1" == "-v" || "$1" == "--vuetorrent" ]] && updateVuetorrent
alejandra "$FLAKE" alejandra -q "$FLAKE"