Added bash script to sync dotfiles

This commit is contained in:
Nicholas Novak
2026-09-01 19:31:46 +00:00
parent 18b6df547a
commit d26f0656f7
2 changed files with 35 additions and 0 deletions
@@ -0,0 +1,2 @@
$/home/nicholas/git/dotfiles/.jj/repo
Executable
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
set -eu
cd -- "$(dirname -- "$0")"
desync=false
case "${1:-}" in
-d|--desync)
desync=true
;;
"")
;;
*)
printf 'Usage: %s [--desync|-d]\n' "$0" >&2
exit 2
;;
esac
for path in */; do
[ -d "$path" ] || continue
name=${path%/}
if "$desync"; then
printf 'Unstowing %s...\n' "$name"
stow --delete --target "$HOME" --verbose "$name"
else
printf 'Stowing %s...\n' "$name"
stow --restow --target "$HOME" --verbose "$name"
fi
done