dotfiles/.archive/copy-dots.bash

32 lines
880 B
Bash
Raw Normal View History

2023-09-15 22:59:26 +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"