refractor(bootstrap): Format with shfmt

This commit is contained in:
js0ny 2025-02-24 00:42:55 +00:00
parent f015467b1b
commit 0ce74497cd
21 changed files with 271 additions and 377 deletions

View file

@ -1,9 +1,10 @@
#!/usr/bin/env bash
# vim:ft=bash
set -e # Exit immediately if a command exits with a non-zero status
declare -A linkDots
source "$DOTFILES/bootstrap/components/symlinks.sh"
source "$DOTFILES/bootstrap/components/symlinks.bash"
echo "[INFO] DOTFILES = $DOTFILES"
@ -13,16 +14,16 @@ read -n 1
echo "[INFO] Setting up symbolic links"
for src in "${!linkDots[@]}"; do
dest="${linkDots[$src]}"
echo "Linking $src to $dest"
if [ -d "$src" ]; then
test -d "$dest" && mv "$dest" "$dest.bak"
ln -sf "$src" "$dest"
elif [ -f "$src" ]; then
dest_parent=$(dirname "$dest")
test -d "$dest_parent" || mkdir -p "$dest_parent"
ln -sf "$src" "$dest"
else
echo "[ERROR] $src does not exist"
fi
dest="${linkDots[$src]}"
echo "Linking $src to $dest"
if [ -d "$src" ]; then
test -d "$dest" && mv "$dest" "$dest.bak"
ln -sf "$src" "$dest"
elif [ -f "$src" ]; then
dest_parent=$(dirname "$dest")
test -d "$dest_parent" || mkdir -p "$dest_parent"
ln -sf "$src" "$dest"
else
echo "[ERROR] $src does not exist"
fi
done