refactor(wip): fix some stuff in update script
This commit is contained in:
parent
699666bf48
commit
89e9df4ad1
1 changed files with 16 additions and 20 deletions
36
updateSha.sh
36
updateSha.sh
|
@ -1,19 +1,14 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
parseNurl() {
|
parseNurl() {
|
||||||
REV=$(nurl -j "$1" | jq '.["args"].["rev"]')
|
REV=$(nurl -j "$1" | jq '.["args"].["rev"]')
|
||||||
HASH=$(nurl -j "$1" | jq '.["args"].["hash"]')
|
HASH=$(nurl -j "$1" | jq '.["args"].["hash"]')
|
||||||
|
|
||||||
sed -i "s,rev = .*,rev = $REV;," "$2"
|
sed -i "s,rev = .*,rev = $REV;," "$2"
|
||||||
sed -i "s,hash = .*,hash = $HASH;," "$2"
|
sed -i "s,hash = .*,hash = $HASH;," "$2"
|
||||||
}
|
|
||||||
|
|
||||||
updateVencord() {
|
|
||||||
parseNurl https://github.com/Vendicated/Vencord /home/matt/.nix/common/overlays/vencord.nix
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
#parseNurl "https://github.com/lukas-reineke/indent-blankline.nvim"
|
|
||||||
|
|
||||||
# https://github.com/dracula/xresources
|
# https://github.com/dracula/xresources
|
||||||
# https://github.com/dracula/plymouth
|
# https://github.com/dracula/plymouth
|
||||||
|
@ -26,20 +21,20 @@ updateVencord() {
|
||||||
updateFirefoxAddons() {
|
updateFirefoxAddons() {
|
||||||
echo "Updating firefox addons using mozilla-addons-to-nix"
|
echo "Updating firefox addons using mozilla-addons-to-nix"
|
||||||
|
|
||||||
(cd /home/matt/.nix/modules/firefox/addons || return;
|
(cd /home/matt/.nix/home/firefox/addons || return;
|
||||||
|
|
||||||
file=generated-firefox-addons.nix
|
file=generated-firefox-addons.nix
|
||||||
if [[ -f $file ]]; then
|
if [[ -f $file ]]; then
|
||||||
printf "\nOld versions: \n"
|
printf "\nOld versions: \n"
|
||||||
|
|
||||||
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"
|
printf "\nNew versions: \n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mozilla-addons-to-nix addons.json generated-firefox-addons.nix)
|
mozilla-addons-to-nix addons.json generated-firefox-addons.nix)
|
||||||
}
|
}
|
||||||
|
|
||||||
doAll() {
|
doAll() {
|
||||||
|
@ -47,5 +42,6 @@ doAll() {
|
||||||
}
|
}
|
||||||
|
|
||||||
[[ "$1" == "-a" || "$1" == "--all" ]] && doAll
|
[[ "$1" == "-a" || "$1" == "--all" ]] && doAll
|
||||||
[[ "$1" == "-v" || "$1" == "--vencord" ]] && updateVencord
|
|
||||||
[[ "$1" == "-f" || "$1" == "--firefox" ]] && updateFirefoxAddons
|
[[ "$1" == "-f" || "$1" == "--firefox" ]] && updateFirefoxAddons
|
||||||
|
|
||||||
|
alejandra /home/matt/.nix
|
||||||
|
|
Loading…
Reference in a new issue