dotfiles/archive/copy-dots.bash
2024-02-01 11:34:16 -06:00

32 lines
880 B
Bash
Executable File

#!/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"