Files
debian13-admin-workstation/install/09-dotfiles.sh
T
2026-09-27 19:59:50 +02:00

31 lines
916 B
Bash
Executable File

#!/usr/bin/env bash
set -e
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DOTFILES_DIR="$PROJECT_DIR/dotfiles"
echo "==> Installiere Dotfiles..."
mkdir -p "$HOME/.config"
if command -v rsync >/dev/null 2>&1; then
rsync -a "$DOTFILES_DIR/.bashrc" "$HOME/" 2>/dev/null || true
rsync -a "$DOTFILES_DIR/.gitconfig" "$HOME/" 2>/dev/null || true
rsync -a "$DOTFILES_DIR/.tmux.conf" "$HOME/" 2>/dev/null || true
if [ -d "$DOTFILES_DIR/.config" ]; then
rsync -a --delete "$DOTFILES_DIR/.config/" "$HOME/.config/"
fi
else
cp -f "$DOTFILES_DIR/.bashrc" "$HOME/" 2>/dev/null || true
cp -f "$DOTFILES_DIR/.gitconfig" "$HOME/" 2>/dev/null || true
cp -f "$DOTFILES_DIR/.tmux.conf" "$HOME/" 2>/dev/null || true
if [ -d "$DOTFILES_DIR/.config" ]; then
cp -a "$DOTFILES_DIR/.config/." "$HOME/.config/"
fi
fi
echo "==> Dotfiles erfolgreich installiert."