forked from Shinonome/alt-illogical-impulse
Add matugen directory to backup handling
- Add matugen to writable-mode backup script directory list - Add matugen conflict handling to Home Manager activation script - Handle both symlinked and regular matugen directories - Prevents activation failures due to existing matugen configs This resolves the 'mkdir: cannot create directory' and 'ln: failed to create symbolic link' errors that occur when ~/.config/matugen already exists during Home Manager activation.
This commit is contained in:
@@ -195,6 +195,11 @@ EOF
|
||||
$DRY_RUN_CMD echo " → Removed conflicting symlinked fish config"
|
||||
fi
|
||||
|
||||
if [[ -L "$HOME/.config/matugen" ]]; then
|
||||
$DRY_RUN_CMD rm "$HOME/.config/matugen"
|
||||
$DRY_RUN_CMD echo " → Removed conflicting symlinked matugen config"
|
||||
fi
|
||||
|
||||
# Also handle if they exist as regular directories
|
||||
if [[ -d "$HOME/.local/share/konsole" && ! -L "$HOME/.local/share/konsole" ]]; then
|
||||
$DRY_RUN_CMD mv "$HOME/.local/share/konsole" "$HOME/.local/share/konsole.backup-$(date +%Y%m%d-%H%M%S)"
|
||||
@@ -205,6 +210,11 @@ EOF
|
||||
$DRY_RUN_CMD mv "$HOME/.config/fish" "$HOME/.config/fish.backup-$(date +%Y%m%d-%H%M%S)"
|
||||
$DRY_RUN_CMD echo " → Backed up existing fish config directory"
|
||||
fi
|
||||
|
||||
if [[ -d "$HOME/.config/matugen" && ! -L "$HOME/.config/matugen" ]]; then
|
||||
$DRY_RUN_CMD mv "$HOME/.config/matugen" "$HOME/.config/matugen.backup-$(date +%Y%m%d-%H%M%S)"
|
||||
$DRY_RUN_CMD echo " → Backed up existing matugen config directory"
|
||||
fi
|
||||
'';
|
||||
|
||||
# Copy quickshell config after link generation
|
||||
|
||||
@@ -58,7 +58,7 @@ let
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
# Backup specific directories that will be overwritten
|
||||
for dir in quickshell hypr fish foot kitty fuzzel wlogout; do
|
||||
for dir in quickshell hypr fish foot kitty fuzzel wlogout matugen; do
|
||||
if [[ -d "$CONFIG_DIR/$dir" ]]; then
|
||||
info " Backing up $dir"
|
||||
cp -r "$CONFIG_DIR/$dir" "$BACKUP_DIR/" 2>/dev/null || true
|
||||
|
||||
Reference in New Issue
Block a user