#!/usr/bin/env bash
# Update the dotfiles: pull repo, update plugin clones, regenerate the toolkit
# command set. Safe to run anytime; re-run `exec zsh` afterwards.
set -euo pipefail
DOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
echo "== updating dotfiles in $DOT =="
if git -C "$DOT" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
git -C "$DOT" pull --ff-only || echo "git pull skipped (local changes or no remote)"
fi
"$DOT/scripts/install-plugins.sh" update
"$DOT/scripts/gen-pentest-cmds.sh"
echo "== done. reload with: exec zsh =="