- Added comprehensive configuration files for seamless migration - SSH, GPG, Karabiner, iTerm2, Neofetch, SwiftBar configs - Pass license management system with templates and documentation - Enhanced shell functions with MAS updates and moon phase tracking - Comprehensive encrypted backup system (GPG AES256) - Included encrypted backups of all sensitive data - BBEdit as default editor with proper configuration - Fixed shell compatibility issues - Merged existing .zsh configs with improvements Security: - All sensitive data is GPG encrypted (.gpg files) - Private keys excluded from version control - Only configs and encrypted backups are tracked Following prime directive: durable, thoughtful solutions 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
93 lines
2.8 KiB
Bash
Executable File
93 lines
2.8 KiB
Bash
Executable File
#!/usr/bin/env zsh
|
|
# Safe shell configuration reload with conflict resolution
|
|
# Embodies μέτρον: thoughtful, measured approach to shell management
|
|
|
|
set -euo pipefail
|
|
|
|
DOTFILES_DIR="$HOME/dotfiles"
|
|
|
|
# Colors
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m'
|
|
|
|
echo -e "${YELLOW}🔧 Safe Shell Configuration Reload${NC}"
|
|
echo "Following prime directive: durable solutions over expedient fixes"
|
|
echo ""
|
|
|
|
# Step 1: Clear conflicting aliases
|
|
echo "1️⃣ Clearing potential conflicts..."
|
|
unalias cd chamber 2>/dev/null || true
|
|
echo " ✅ Aliases cleared"
|
|
|
|
# Step 2: Load in proper order with error handling
|
|
echo "2️⃣ Loading configuration modules..."
|
|
|
|
# Environment first (sets foundation)
|
|
if source "$DOTFILES_DIR/shell/environment.zsh" 2>/dev/null; then
|
|
echo " ✅ Environment loaded"
|
|
else
|
|
echo -e " ${RED}❌ Environment failed${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
# Paths second (builds PATH properly)
|
|
if source "$DOTFILES_DIR/shell/paths.zsh" 2>/dev/null; then
|
|
echo " ✅ Paths loaded"
|
|
else
|
|
echo -e " ${RED}❌ Paths failed${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
# Functions third (defines utilities)
|
|
if source "$DOTFILES_DIR/shell/functions.zsh" 2>/dev/null; then
|
|
echo " ✅ Functions loaded"
|
|
else
|
|
echo -e " ${RED}❌ Functions failed - attempting repair${NC}"
|
|
|
|
# Attempt repair: comment out problematic functions
|
|
echo " 🔧 Attempting automatic repair..."
|
|
|
|
# Create backup
|
|
cp "$DOTFILES_DIR/shell/functions.zsh" "$DOTFILES_DIR/shell/functions.zsh.backup.$(date +%Y%m%d_%H%M%S)"
|
|
|
|
# Temporarily disable chamber function
|
|
sed -i.tmp 's/^chamber()/# chamber() # DISABLED/' "$DOTFILES_DIR/shell/functions.zsh"
|
|
|
|
if source "$DOTFILES_DIR/shell/functions.zsh" 2>/dev/null; then
|
|
echo " ✅ Functions loaded (chamber disabled)"
|
|
echo " 📝 Chamber function disabled - investigate separately"
|
|
else
|
|
echo -e " ${RED}❌ Functions still failing${NC}"
|
|
# Restore backup
|
|
mv "$DOTFILES_DIR/shell/functions.zsh.backup.$(date +%Y%m%d_%H%M%S)" "$DOTFILES_DIR/shell/functions.zsh"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# Aliases last (safe to override)
|
|
if source "$DOTFILES_DIR/shell/aliases.zsh" 2>/dev/null; then
|
|
echo " ✅ Aliases loaded"
|
|
else
|
|
echo -e " ${YELLOW}⚠️ Aliases had issues - continuing${NC}"
|
|
fi
|
|
|
|
echo ""
|
|
echo -e "${GREEN}✅ Shell configuration successfully reloaded${NC}"
|
|
echo "🎯 Test your sysupdate function now"
|
|
|
|
# Test critical functions
|
|
echo ""
|
|
echo "3️⃣ Testing critical functions..."
|
|
if declare -f sysupdate >/dev/null; then
|
|
echo " ✅ sysupdate function available"
|
|
else
|
|
echo -e " ${RED}❌ sysupdate not found${NC}"
|
|
fi
|
|
|
|
if declare -f detect_context >/dev/null; then
|
|
echo " ✅ detect_context function available"
|
|
else
|
|
echo -e " ${YELLOW}⚠️ detect_context not found${NC}"
|
|
fi |