-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
75 lines (62 loc) · 1.66 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
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
#!/bin/sh
##############################
# DESCRIPTION
##############################
# This script is used to install all of the dotfiles
##############################
# COMMAND LINE OPTIONS
##############################
# -c :: if specified, will install apps via homebrew cas#
# -d :: if specified, will install developer tools
##############################
# BEGIN SCRIPT
##############################
# Default command line arg values
INSTALL_HOMEBREW=false
INSTALL_DEV_TOOLS=false
## Step 0: Parse command line args
while getopts cd opt; do
case $opt in
c)
INSTALL_HOMEBREW=true
echo "-c specified! Will install programs via Homebrew" >&2
;;
d)
INSTALL_DEV_TOOLS=true
echo "installing developer tools" >&2
;;
*)
echo "Invalid option: -$OPTARG" >&2
exit
;;
esac
done
## install programs via Homebrew
if [ "$INSTALL_HOMEBREW" = true ] ; then
echo "Installing apps via Homebrew"
if [ "$INSTALL_DEV_TOOLS" = true ]
then
sh brew.sh installExtraDevTools
else
sh brew.sh
fi
fi
## Create symlinks to aliases/env variables
echo "Installing aliases/env-variables"
create_symlink_from_user_root()
{
ln -s `pwd`/$1 ~/$1
}
create_symlink_from_user_root .index-dotfile
create_symlink_from_user_root .aliases
create_symlink_from_user_root .general-setup
create_symlink_from_user_root .custom-command-line-prompt
create_symlink_from_user_root .env-variables
source ~/.general-setup
source ~/.index-dotfile
# Set default Node to system version
nvm alias default system
# Create .gitconfig symlink
echo "Installing Git config"
rm -rf ~/.gitconfig
ln -s `pwd`/.gitconfig ~/.gitconfig