forked from jondavidjohn/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·93 lines (69 loc) · 1.73 KB
/
install
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
# Per OS deps
## OSX
### Command Line build tools
### homebrew
# General Deps (Maybe?)
## tree
## node
## npm
## vim
## python
## rvm (and latest ruby)
## git
## svn
## ack
## jshint
## bash_completion
GREEN="\033[32m"
YELLOW="\033[33m"
BLUE="\033[34m"
RED="\033[31m"
ENDCOLOR="\033[0m"
OS="unkown"
WORK="ifit"
if [[ `uname` == 'Darwin' ]]; then
OS='osx'
elif type apt-get &> /dev/null; then
OS='debian'
elif type yum &> /dev/null; then
OS='rhel'
fi
echo -e "${YELLOW} Linking general files...${ENDCOLOR}"
while read location; do
name=$(basename "$location")
if [ -d "$HOME/$name" ]; then
rm -rf "$HOME/$name"
fi
echo -e "${BLUE} $name${ENDCOLOR}"
ln -nsf "$location" "$HOME/$name"
done < <(find "$HOME/.dotfiles/general" -depth 1)
echo -e "${YELLOW} Linking $OS files...${ENDCOLOR}"
while read location; do
name=$(basename "$location")
if [ -d "$HOME/$name" ]; then
rm -rf "$HOME/$name"
fi
echo -e "${BLUE} $name${ENDCOLOR}"
ln -nsf "$location" "$HOME/$name"
done < <(find "$HOME/.dotfiles/os/$OS" -depth 1)
# Link up ST3 config
if [ $OS == 'osx' ]; then
echo -e "${YELLOW} Linking ST3 Config${ENDCOLOR}"
if [ -d ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User ]; then
rm -rf ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User
fi
ln -nsf "$HOME/.subl" ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User
fi
if [[ $* == *--work* ]]; then
echo -e "${YELLOW} Linking $WORK files...${ENDCOLOR}"
while read location; do
name=$(basename "$location")
if [ -d "$HOME/$name" ]; then
rm -rf "$HOME/$name"
fi
echo -e "${BLUE} $name${ENDCOLOR}"
ln -nsf "$location" "$HOME/$name"
done < <(find "$HOME/.dotfiles/work/$WORK" -depth 1)
fi
source ~/.bash_profile