Overhauled bootstrap files

This commit is contained in:
Michel Fedde 2025-02-23 18:25:03 +01:00
parent abed723ceb
commit 52ad4a6b19
8 changed files with 26 additions and 3 deletions

View file

@ -4,6 +4,29 @@
# execute all executable files (excluding templates and editor backups) in the
# ~/.config/yadm/bootstrap.d directory when run.
_repeat() {
local start=1
local end=${1:-80}
local str="${2:-=}"
local range=$(seq $start $end)
for i in $range; do echo -n "${str}"; done
}
display() {
local value="$1"
echo -n "/="
_repeat ${#value} "="
echo "=\\"
echo -n "| "
echo -n ${value}
echo " |"
echo -n "\\="
_repeat ${#value} "="
echo "=/"
}
set -eu
# Directory to look for bootstrap executables in
@ -22,11 +45,11 @@ while IFS= read -r bootstrap; do
done < <(find -L "$BOOTSTRAP_D" -type f | sort)
for bootstrap in "${bootstraps[@]}"; do
echo "----------------------------"
echo "# Executing $bootstrap"
display "Executing $bootstrap"
if ! "$bootstrap"; then
echo "Error: bootstrap '$bootstrap' failed" >&2
exit 1
fi
done
display "Bootstrap completed"

View file

@ -4,7 +4,7 @@ echo "Installing general apps"
yay -S --needed neovim \
network-manager-applet \
kitty \
ghostty \
btop \
zoxide fzf \
superfile