-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·115 lines (102 loc) · 2.77 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
printf "\n************\nSetting up dev\n"
prompt() {
choice=false
read -r -p "y/n? " yn
case $yn in
[Yy]* ) choice=true;;
* );;
esac
}
# Install Homebrew or update
if ! which -s brew
then
printf "\nDo you want to install Homebrew?\n"
prompt
install_brew=$choice
if [ "$install_brew" == true ]; then
printf "Installing homebrew\n"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
printf "\n*****\n\n"
fi
else
printf "\nHomebrew is installed, do you wish to update?\n"
prompt
update_brew=$choice
if [ "$update_brew" == true ]; then
brew update -v
fi
fi
# Install rvm or update
if ! which -s rvm
then
printf "\nDo you want to install RVM?\n"
prompt
install_rvm=$choice
if [ "$install_rvm" == true ]; then
printf "Installing rvm\n"
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable --ruby=2.3.0,2.4.2,2.5.0 --gems=bundler,pry,dotenv --ignore-dotfiles
# shellcheck source=/dev/null
source "$HOME/.rvm/scripts/rvm"
printf "\n*****\n\n"
fi
else
printf "\nRVM is installed, do you wish to update?\n"
prompt
update_rvm=$choice
if [ "$update_rvm" == true ]; then
rvm get stable
printf "\n*****\n\n"
fi
fi
name_of_curr_dir=${PWD##*/}
if [ "$name_of_curr_dir" != 'dotfiles' ]; then
printf "\nDotfiles not cloned yet, do you wish to clone them?\n"
prompt
install_dots=$choice
if [ $install_dots == true ]; then
mkdir -p "$HOME/code"
cd "$HOME/code"
git clone 'https://github.com/matchbookmac/dotfiles.git'
cd dotfiles
git submodule update --init
fi
fi
printf "\nDo you want to install Homebrew packages?\n"
prompt
install_pkgs=$choice
if [ "$install_pkgs" == true ]; then
brew update
brew tap homebrew/bundle
brew bundle
fi
if which -s rcup
then
printf "\nLink dotfiles with rcm?\n"
prompt
link_dots=$choice
if [ "$link_dots" == true ]; then
printf "\nLinking dotfiles with rcm.\n"
RCRC=rcrc rcup -v
# make bin files executable
chmod -R +x "$( cd -P $( dirname $BASH_SOURCE ) && pwd )/bin"
fi
fi
printf "\nInstall Vim Packages?\n"
prompt
install_vim_stuff=$choice
if [ "$install_vim_stuff" == true ]; then
mkdir -p "$HOME/.vim/bundle"
vim +PlugInstall +qa
fi
printf "\nAdd System Settings for OSX?\n(You might really want to read these first)\n"
prompt
sys_sets=$choice
if [ "$sys_sets" == true ]; then
# shellcheck source=/dev/null
source system/osx-settings
fi
# shellcheck source=/dev/null
source "$HOME/.profile"
printf "\nSetup complete\n\n************\n\n"