[dots] fancier update command

This commit is contained in:
odrling 2024-02-22 21:58:07 +01:00
parent 518fdfb015
commit 8afa3ff53f
No known key found for this signature in database
GPG key ID: E24CA7508C27AF5B
2 changed files with 42 additions and 11 deletions

View file

@ -1,20 +1,34 @@
#!/bin/sh
#!/bin/bash
die() {
echo -e " ${NOCOLOR-\e[1;31m*\e[0m }${*}" >&2
exit 1
}
einfo() {
echo -e " ${NOCOLOR-\e[1;32m*\e[0m }${*}" >&2
}
ewarn() {
echo -e " ${NOCOLOR-\e[1;33m*\e[0m }${*}" >&2
}
if command -v nvim > /dev/null 2>&1; then
echo updating nvim
einfo "updating nvim"
BOOTSTRAP_NEOVIM=1 nvim --headless
nvim --headless "+Lazy! restore" +qa
nvim --headless "+Lazy! restore" +qa || ewarn "nvim ended with status $?"
fi
if command -v pipx > /dev/null 2>&1; then
echo update hikari
pipx upgrade hikari
einfo "updating hikari"
pipx upgrade hikari || ewarn "hikari update failed"
fi
for i in ~/.mozilla/firefox/*/; do
einfo "installing Betterfox in $i"
cp -v ~/.mozilla/Betterfox/user.js "$i"
done
echo update uosc ziggy
einfo "updating uosc ziggy"
export GOFLAGS="-buildmode=pie -trimpath '-ldflags=-linkmode=external -s'"
command -v go > /dev/null 2>&1 && go build -C "$HOME/.config/mpv/submodules/uosc" -o "$HOME/.config/mpv/scripts/uosc/bin/ziggy-linux" "$HOME/.config/mpv/submodules/uosc/src/ziggy"
command -v go > /dev/null 2>&1 && go build -C "$HOME/.config/mpv/submodules/uosc" -o "$HOME/.config/mpv/scripts/uosc/bin/ziggy-linux" "$HOME/.config/mpv/submodules/uosc/src/ziggy" || ewarn "ziggy build failed"

View file

@ -1,11 +1,28 @@
#!/bin/sh -e
#!/bin/bash -e
die() {
echo -e " ${NOCOLOR-\e[1;31m*\e[0m }${*}" >&2
exit 1
}
einfo() {
echo -e " ${NOCOLOR-\e[1;32m*\e[0m }${*}" >&2
}
ewarn() {
echo -e " ${NOCOLOR-\e[1;33m*\e[0m }${*}" >&2
}
remote=$(git rev-parse --abbrev-ref --symbolic-full-name '@{u}')
einfo "remote branch is $remote"
git fetch "$(echo "$remote" | sed 's|/.*$||')"
command -v gpg > /dev/null || echo gpg not found
command -v gpg > /dev/null || die "gpg not found"
gpg --import ~/.local/odrling.pub 2> /dev/null
dots verify-commit "$remote"
git rebase --autostash "$remote"
dots verify-commit "$remote" || die "verify-commit failed"
einfo "latest commit has known signature"
git rebase --autostash "$remote" || die "rebase failed"
dots-postupdate