config: fix bootstrap issues

This commit is contained in:
xeruf 2021-12-02 23:47:44 +01:00
parent f907128446
commit bf05f9f175
3 changed files with 9 additions and 6 deletions

View File

@ -70,12 +70,15 @@ edshell() {
(prof*) file="$HOME/.zprofile";;
(-f) grepfile="$(grep --recursive "\(^$2()\|alias $2=\)" $CONFIG_SHELLS -n -m 1)"
file="$(echo "$grepfile" | cut -d':' -f1)"
line="$(echo "$grepfile" | cut -d':' -f2)";;
line="$(echo "$grepfile" | cut -d':' -f2)"
test -f "$file" || return 2;;
(*) file="$(find $CONFIG_SHELLS -name "$1*" | head -1 | grep . || echo "$CONFIG_SHELLS/$1")";;
esac
test -f "$file" || checksum="$(md5sum "$file")"
test -f "$file" && checksum="$(md5sum "$file")"
$EDITOR "$(test "$line" && echo "+normal! ${line}ggzx" || echo "--")" "${file%:*}"
test "$checksum" != "$(md5sum $file)" && source "$HOME/.zprofile" && exec $SHELL
#test -f "$file" || return 1
test "$checksum" != "$(md5sum $file)" &&
source "$HOME/.zprofile" && exec $SHELL
}

View File

@ -29,7 +29,7 @@ test -d "/etc/yadm" || sy clone
## Software
section "Software"
link() {
test -e "$2" || $(checkacess -w "$2" || echo sudo) ln -sv "$@"
test -e "$2" || $(checkaccess -w "$2" || echo sudo) ln -sv "$@"
}
mkdir -p .config/audacity

View File

@ -6,8 +6,8 @@ case "$1" in
("") sysyadm s;;
(p) sysyadm p;;
(l) sysyadm fetch && sy rebase main --onto origin/main;;
(clone) sysyadm clone -w / git.jfischer.org:xeruf/etc.git --bootstrap;;
(init) sysyadm init -b main -w /;;
(clone) sudo -E sysyadm clone -w / 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