-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·44 lines (38 loc) · 1.25 KB
/
install.sh
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
#!/bin/bash
os=${OSTYPE//[0-9.]/}
echo $os
# Creates a symlink to the file, prompting if a file already exists
# there
# $1 = original file location
# $2 = symlink's location
function create_symlink {
should_create_symlink=true
if [ -e $2 ] || [ -L $2 ]
then
echo $2 " already exists. Replace file? (y/n)"
read replace_file
if [ "$replace_file" == "y" ] ; then
rm -rf $2
else
should_create_symlink=false
fi
fi
if $should_create_symlink ; then
ln -sf $1 $2
fi
}
# emacs
create_symlink `pwd`"/emacs/.emacs" $HOME"/.emacs"
create_symlink `pwd`"/emacs/.emacs.d" $HOME"/.emacs.d"
# terminal
create_symlink `pwd`/terminal/.profile $HOME"/.profile"
create_symlink `pwd`/terminal/.bashrc $HOME"/.bashrc"
create_symlink `pwd`/terminal/.bashrc-linux $HOME"/.bashrc-linux"
create_symlink `pwd`/terminal/.bashrc-mac $HOME"/.bashrc-mac"
create_symlink `pwd`/terminal/.git-prompt.sh $HOME"/.git-prompt.sh"
# git
git config --global user.name "Charlie Andrews"
git config --global core.editor emacs
git config --global credential.helper 'cache --timeout=86400'
create_symlink `pwd`/terminal/.gitignore_global $HOME"/.gitignore_global"
git config --global core.excludesfile $HOME/.gitignore_global