Files
nixos/henrovnix_ok/assets/scripts/recreate_config.sh
T
2026-03-01 22:27:54 +01:00

18 lines
702 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Source and destination directories
SOURCE_DIR="./assets/conf/.config"
DEST_DIR="$HOME/.config"
# Check if source directory exists
if [ ! -d "$SOURCE_DIR" ]; then
echo "Error: Source directory $SOURCE_DIR does not exist."
exit 1
fi
# Create destination directory if it doesn't exist
mkdir -p "$DEST_DIR"
# Use rsync to copy files, overwriting symlinks and existing files
# --delete removes files in DEST_DIR that are not in SOURCE_DIR
# --no-group --no-owner preserves your user ownership
rsync -av --no-group --no-owner --delete "$SOURCE_DIR/" "$DEST_DIR/"
echo "Config files copied from $SOURCE_DIR to $DEST_DIR. Symlinks replaced with editable files."