dotfiles/.local/bin/scripts/sy

18 lines
616 B
Bash
Executable File

#!/bin/sh
# Conveniently use sysyadm
unignore="/etc/yadm/unignore"
test -r "$unignore" && cat "$unignore" | while read f; do eval ls -d $f; done | sysyadm add --intent-to-add --pathspec-from-file=- 2>/dev/null
case "$1" in
("") sysyadm s;;
(p) sysyadm p;;
(l) sysyadm fetch && sy rebase main --onto origin/main;;
(clone)
sudo mkdir -p /etc/yadm
sudo chown -R $USER /etc/yadm
sysyadm clone -w / gitea@git.jfischer.org:xeruf/etc.git --bootstrap;;
(init) sudo -E sysyadm init -b main -w /;;
(*) sudo -E sysyadm "$@";;
esac
sudo chown -R $USER /etc/yadm
sudo chmod ugo+rw /tmp/git -R 2>/dev/null