-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·48 lines (42 loc) · 814 Bytes
/
setup.sh
File metadata and controls
executable file
·48 lines (42 loc) · 814 Bytes
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
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -eu
# echo -n "input your github account: "
# read GITHUB_USER
# export GITHUB_USER
git submodule update --init --recursive
if [ "$(uname)" = "Darwin" ]; then
sh setup/setup_mac.sh
elif [ "$(uname)" = "Linux" ]; then
sh setup/setup_linux.sh
fi
path=$(cd $(dirname $0); pwd)
# copy dotfiles
for file in $(ls homedot)
do
from=$path/homedot/$file
to="$HOME/."$file
if [ -L $to ]; then
rm $to
elif [ -e $to ]; then
read -p "replace ~/.$file ? [y/n] "
if [ "$REPLY" = "y" ]; then
rm -rf $to
fi
fi
if [ ! -e $to ]; then
ln -sf $from $to
fi
done
# copy normal files
for file in $(ls home)
do
from=$path/home/$file
to="$HOME/"$file
if [ -L $to ]; then
rm $to
fi
ln -sf $from $to
done
# make directories
cd ~
mkdir -p bin lib src tmp .vim/tmp