2019-08-15 05:50:59 +00:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
|
|
echo 'Syncing configuration files to your home dir...'
|
|
|
|
|
2019-08-17 16:19:04 +00:00
|
|
|
set_color brgrey
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2019-08-15 06:20:46 +00:00
|
|
|
if ! test -e ~/.config; mkdir ~/.config; end
|
|
|
|
|
2019-08-15 05:50:59 +00:00
|
|
|
rsync -aP ./.config/fish ~/.config/
|
|
|
|
rsync -aP ./.gitconfig ~/
|
|
|
|
rsync -aP ./.tmux* ~/
|
|
|
|
rsync -aP ./.vim* ~/
|
2019-08-20 13:59:10 +00:00
|
|
|
rsync -aP ./.ideavimrc ~/
|
2019-08-15 05:50:59 +00:00
|
|
|
|
2019-08-17 16:19:04 +00:00
|
|
|
echo
|
2019-08-17 06:12:45 +00:00
|
|
|
fisher
|
|
|
|
|
2019-08-17 16:19:04 +00:00
|
|
|
set_color normal
|
2019-08-17 06:12:45 +00:00
|
|
|
|
|
|
|
|
2019-08-17 16:19:04 +00:00
|
|
|
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")
|
2019-08-17 06:12:45 +00:00
|
|
|
|
2019-08-17 16:19:04 +00:00
|
|
|
if test -z "$set_git_user"; or test "$set_git_user" = 'y'; or test "$set_git_user" = 'Y'
|
|
|
|
set -l name (read -P 'name: ')
|
2019-08-17 06:12:45 +00:00
|
|
|
|
2019-08-17 16:19:04 +00:00
|
|
|
git config --global user.name $name
|
|
|
|
|
|
|
|
set -l email (read -P 'email: ')
|
2019-08-17 06:12:45 +00:00
|
|
|
|
|
|
|
git config --global user.email $email
|
|
|
|
end
|
|
|
|
|
2019-08-17 16:19:04 +00:00
|
|
|
if test ! "$cwd" = 'dotfiles'
|
|
|
|
cd ..
|
|
|
|
rm -rf ./dotfiles
|
|
|
|
cd $fwd
|
|
|
|
end
|
|
|
|
|
2019-08-17 06:12:45 +00:00
|
|
|
echo -s \n 'Done syncing.'
|