home-manager/dotfiles/.archive/copy-dots.bash

32 lines
880 B
Bash
Raw Normal View History

2024-08-18 19:31:22 +02:00
#!/usr/bin/env bash
git_files=$(cd "${HOME}" && git ls-tree --name-only main)
while IFS= read -r line; do
case $line in
".config")
config_files=$(cd "${HOME}/.config" && git ls-tree --name-only main)
mkdir -p "$(pwd)/.config"
while IFS= read -r line; do
cp -rfv "${HOME}/.config/$line" "$(pwd)/.config/"
done <<< "$config_files"
;;
".gitignore")
echo "Skipping .gitignore"
;;
".gnupg")
echo "Skipping .gnupg"
;;
".local")
mkdir -p "$(pwd)/.local/share"
cp -rfv "${HOME}/.local/share/rofi" "$(pwd)/.local/share/"
;;
".ssh")
echo "Skipping .ssh"
;;
*)
cp -rfv "${HOME}/$line" "$(pwd)/"
;;
esac
done <<< "$git_files"