From d26f0656f74c00b179d2cf0f92b3e5d75571f082 Mon Sep 17 00:00:00 2001 From: Nicholas Novak Date: Tue, 1 Sep 2026 19:30:01 +0000 Subject: [PATCH] Added bash script to sync dotfiles --- .../repos/512b354930088775a398/metadata.binpb | 2 ++ sync.sh | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 jj/.config/jj/repos/512b354930088775a398/metadata.binpb create mode 100755 sync.sh diff --git a/jj/.config/jj/repos/512b354930088775a398/metadata.binpb b/jj/.config/jj/repos/512b354930088775a398/metadata.binpb new file mode 100644 index 0000000..7ceae01 --- /dev/null +++ b/jj/.config/jj/repos/512b354930088775a398/metadata.binpb @@ -0,0 +1,2 @@ + +$/home/nicholas/git/dotfiles/.jj/repo \ No newline at end of file diff --git a/sync.sh b/sync.sh new file mode 100755 index 0000000..d1b503d --- /dev/null +++ b/sync.sh @@ -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