-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.sh
56 lines (43 loc) · 1.07 KB
/
setup.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
45
46
47
48
49
50
51
52
53
54
55
56
# https://github.com/tadija/AEDotFiles
# setup.sh
### - helpers
function print() {
echo "> $1"
echo ""
}
function printFile() {
echo "- Displaying $1"
dashes=----------------------------------------
echo "<$dashes"
cat $1
echo "$dashes>"
echo ""
}
function backupFile() {
if [ -e $1 ]; then
timestamp=$(date "+%Y%m%d-%H%M%S")
backupFile=$1-$timestamp.backup
mv "$1" "$backupFile"
print "Moved existing $1 -> $backupFile"
fi
}
### - main
echo ""
print "Hello $USER!"
shellFile=".zshrc"
backupFile "$HOME/$shellFile"
backupFile "$HOME/.gitconfig"
backupFile "$HOME/.lldbinit"
backupFile "$HOME/.tmux.conf"
df=$HOME/.dotfiles
ln -s $df/.shell_file $HOME/.shell_file
ln -s $df/.gitconfig $HOME/.gitconfig
ln -s $df/.lldbinit $HOME/.lldbinit
ln -s $df/.tmux.conf $HOME/.tmux.conf
mv $HOME/.shell_file $HOME/$shellFile
print "This is how your new $shellFile looks now:"
printFile $HOME/$shellFile
print "Loading $shellFile:"
source "$HOME/$shellFile"
echo "" && print "Finished loading $shellFile"
print "See more: https://github.com/tadija/AEDotFiles"