mirror of
https://github.com/awatertrevi/macos-configuration.git
synced 2026-09-22 10:10:36 +00:00
Track ~/.aws/config (profiles only, never credentials) as a copied config: setup.sh restores it, update.fish refreshes it. Document the S3 state backend setup for resoftware-iac in the README, including the config/credentials profile-header gotcha behind "failed to get shared config profile". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
69 lines
2.2 KiB
Fish
Executable File
69 lines
2.2 KiB
Fish
Executable File
#!/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:
|
|
#
|
|
# * aws-config <- ~/.aws/config (profiles only; credentials never tracked)
|
|
# * 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
|
|
|
|
# --- AWS config (profiles only, ~/.aws/credentials is never tracked) -------
|
|
set -l aws_config "$HOME/.aws/config"
|
|
if test -f $aws_config
|
|
echo "==> Copying $aws_config -> aws-config"
|
|
cp $aws_config aws-config
|
|
else
|
|
echo "==> Skipping aws-config ($aws_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"
|