#!/bin/bash # Reload chezmoi launchd agents whenever their plist content changes. # This script is rerun by chezmoi when its rendered content changes — and the # sha256 lines below depend on the plist templates, so any plist edit changes # this script's render and triggers a rerun. # # watcher plist hash: {{ include "private_Library/LaunchAgents/com.chezmoi.claude-watcher.plist.tmpl" | sha256sum }} # puller plist hash: {{ include "private_Library/LaunchAgents/com.chezmoi.claude-puller.plist.tmpl" | sha256sum }} # pull-fleet plist hash: {{ include "private_Library/LaunchAgents/com.taskdurations.pull-fleet.plist.tmpl" | sha256sum }} set -eu for label in com.chezmoi.claude-watcher com.chezmoi.claude-puller com.taskdurations.pull-fleet; do plist="$HOME/Library/LaunchAgents/$label.plist" if [ -f "$plist" ]; then launchctl unload "$plist" 2>/dev/null || true launchctl load "$plist" 2>/dev/null || true echo "Reloaded $label" fi done