-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall_mac.sh
More file actions
executable file
·37 lines (33 loc) · 1.04 KB
/
install_mac.sh
File metadata and controls
executable file
·37 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
target='mac'
cd $( dirname ${BASH_SOURCE[0]} )
echo install dot files
pushd ${target}/dotfiles > /dev/null
for file in *
do
if [ -f ~/.$file ]; then
if cmp -s $PWD/$file ~/.$file ; then
echo $file: skipped
else
if [ -f ~/.$file.bak ]; then
echo "$file: sorry, ~/.$file.bak exist, can't backup"
exit 1
else
echo $file: backuped, installed
mv ~/.$file ~/.$file.bak
ln -fs $PWD/$file ~/.$file
fi
fi
else
echo $file: installed
ln -fs $PWD/$file ~/.$file
fi
done
popd > /dev/null
echo
echo setup vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +PlugInstall +qall
echo "If it is the very first time of initialization, execute this:"
echo "> echo 'source ~/.env/${target}/source_script/init' >> ~/.bash_profile"