#!/usr/bin/env fish # Actualise the tracked config files from the current machine state. # # Most files in this repo are symlinked into place (see README), so they are # always current. This script refreshes the ones that are plain copies and # therefore drift out of date: # # * brewfile <- `brew bundle dump` # * claude-settings.json <- ~/.claude/settings.json # * hosts <- /etc/hosts # * serena_config.yml <- ~/.serena/serena_config.yml # # Safe to re-run. Review the diff afterwards and commit what you want to keep. set -l repo (dirname (status --current-filename)) cd $repo; or exit 1 echo "Actualising config in $repo" echo # --- Homebrew packages, casks and VS Code extensions ----------------------- if type -q brew echo "==> Dumping Homebrew bundle -> brewfile" brew bundle dump --file=brewfile --force else echo "==> Skipping brewfile (brew not found)" end # --- Claude Code settings -------------------------------------------------- set -l claude_settings "$HOME/.claude/settings.json" if test -f $claude_settings echo "==> Copying $claude_settings -> claude-settings.json" cp $claude_settings claude-settings.json else echo "==> Skipping claude-settings.json ($claude_settings not found)" end # --- Serena config --------------------------------------------------------- set -l serena_config "$HOME/.serena/serena_config.yml" if test -f $serena_config echo "==> Copying $serena_config -> serena_config.yml" cp $serena_config serena_config.yml else echo "==> Skipping serena_config.yml ($serena_config not found)" end # --- /etc/hosts ------------------------------------------------------------ if test -f /etc/hosts echo "==> Copying /etc/hosts -> hosts" cp /etc/hosts hosts else echo "==> Skipping hosts (/etc/hosts not found)" end echo echo "Done. Review changes:" echo " git -C $repo diff --stat"