Following the μέτρον principle of durable, thoughtful solutions: Shell Configuration: - Add refined .zshrc with modular architecture - Include .p10k.zsh for Powerlevel10k prompt - Add .zprofile for login shell configuration - Update aliases with new dotfiles management tools System Management Tools: - safe-update.sh: System updates with rollback protection - detect-drift.sh: Configuration drift detection - system-health.sh: Comprehensive health monitoring - generate-lockfile.sh: Version tracking for reproducibility Documentation: - ARCHITECTURE.md: Philosophy and design rationale - USAGE.md: Practical guide and troubleshooting Other Updates: - Update symlinks.sh to manage all config files - Add .vimrc configuration - Create Brewfile.lock for version pinning These enhancements provide visibility, safety, and maintainability while following the prime directive of prioritizing durability. 🖖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.2 KiB
Bash
50 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
# Generate version lockfile for reproducible installations
|
|
|
|
set -euo pipefail
|
|
|
|
DOTFILES_DIR="$HOME/dotfiles"
|
|
LOCKFILE="$DOTFILES_DIR/Brewfile.lock"
|
|
TEMP_LOCK="/tmp/Brewfile.lock.new"
|
|
|
|
# Colors
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
echo -e "${BLUE}Generating version lockfile...${NC}"
|
|
|
|
# Create new lockfile
|
|
cat > "$TEMP_LOCK" << EOF
|
|
# Brewfile Lock - Version snapshot for reproducibility
|
|
# Generated: $(date)
|
|
# System: $(sw_vers -productVersion)
|
|
|
|
EOF
|
|
|
|
# Get versions of installed packages
|
|
echo -e "${YELLOW}Capturing package versions...${NC}"
|
|
|
|
echo "# Critical formulae" >> "$TEMP_LOCK"
|
|
brew list --versions --formula | sort >> "$TEMP_LOCK"
|
|
|
|
echo "" >> "$TEMP_LOCK"
|
|
echo "# Casks" >> "$TEMP_LOCK"
|
|
brew list --versions --cask | sort >> "$TEMP_LOCK"
|
|
|
|
# Show differences if lockfile exists
|
|
if [[ -f "$LOCKFILE" ]]; then
|
|
echo -e "${YELLOW}Changes since last lock:${NC}"
|
|
if ! diff "$LOCKFILE" "$TEMP_LOCK" > /dev/null; then
|
|
diff "$LOCKFILE" "$TEMP_LOCK" || true
|
|
else
|
|
echo "No changes detected"
|
|
fi
|
|
fi
|
|
|
|
# Replace lockfile
|
|
mv "$TEMP_LOCK" "$LOCKFILE"
|
|
|
|
echo -e "${GREEN}✅ Lockfile updated: $LOCKFILE${NC}"
|
|
echo -e "${YELLOW}💡 Commit this file to track version changes${NC}" |