dotfiles/sync

54 lines
1.1 KiB
Plaintext
Raw Normal View History

2019-08-15 05:50:59 +00:00
#!/usr/bin/env fish
echo 'Syncing configuration files to your home dir...'
2019-09-08 19:25:04 +00:00
set_color grey
set -l fwd (pwd)
set -l cwd (string match -r '\w+$' $fwd)
if test ! "$cwd" = 'dotfiles'
cd /var/tmp
git clone --recurse-submodules https://github.com/mitchell/dotfiles.git
cd ./dotfiles
echo
end
if ! test -e ~/.config; mkdir ~/.config; end
2019-08-15 05:50:59 +00:00
rsync -aP ./.config/fish ~/.config/
rsync -aP ./.config/kitty ~/.config/
2019-08-15 05:50:59 +00:00
rsync -aP ./.gitconfig ~/
rsync -aP ./.tmux* ~/
rsync -aP ./.vim* ~/
2019-08-20 13:59:10 +00:00
rsync -aP ./.ideavimrc ~/
rsync -aP ./.yabairc ~/
rsync -aP ./.skhdrc ~/
2019-08-15 05:50:59 +00:00
echo
fisher
set_color normal
set -l prompt 'Would you like to set your git user name and email?'
set -l set_git_user (read -p "set_color red; printf '\n$prompt (Y/n) '; set_color normal")
if test -z "$set_git_user"; or test "$set_git_user" = 'y'; or test "$set_git_user" = 'Y'
set -l name (read -P 'name: ')
git config --global user.name $name
set -l email (read -P 'email: ')
git config --global user.email $email
end
if test ! "$cwd" = 'dotfiles'
cd ..
rm -rf ./dotfiles
cd $fwd
end
echo -s \n 'Done syncing.'