-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.bash
executable file
·65 lines (53 loc) · 1.39 KB
/
setup.bash
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
export UNLINK=true
echo "This script must be run from the dotfiles directory"
echo "Press <ENTER> to continue, <Ctrl-C> to cancel ..."
read y
function createSymlink {
if [[ -a $1 ]]; then
echo " WARNING: $1 already exists."
# If Unlink is requested
if [ "$UNLINK" = "true" ]; then
unlink $1
echo " Unlinking $1"
# create the link
export DOTLESS=`echo $1 | sed s/.//`
echo " Symlinking $DOTFILES_DIR/$DOTLESS to $1"
ln -s $DOTFILES_DIR/$DOTLESS $1
else
echo " SKIPPING $1."
fi
else
# create the link
export DOTLESS=`echo $1 | sed s/.//`
echo " Symlinking $DOTFILES_DIR/$DOTLESS to $1"
ln -s $DOTFILES_DIR/$DOTLESS $1
fi
}
echo "Initializing links ..."
pushd ~
DOTFILES_DIR="${HOME}/dotfiles/home"
createSymlink .profile
createSymlink .bashrc
createSymlink .zshrc
createSymlink .zprofile
createSymlink .zlogout
createSymlink .vimrc
createSymlink .tmux.conf
DOTFILES_DIR="${HOME}/dotfiles"
createSymlink .vim
createSymlink .bash_scripts
DOTFILES_DIR="${HOME}/dotfiles/git"
cp -a ~/dotfiles/git/gitconfig ~/.gitconfig
popd
# ===== Copy over fonts ===== #
echo "Copying fonts ..."
if [[ $OSTYPE == linux-gnu ]]; then
mkdir -p ~/.fonts
cp -a fonts/* ~/.fonts/
elif [[ $OSTYPE == darwin* ]]; then
mkdir -p ~/Library/Fonts
cp -a fonts/* ~/Library/Fonts/
else
true
fi