-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
122 lines (99 loc) · 2.84 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
116
117
118
119
120
121
122
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
def getc # NOTE only tested on OS X
system "/bin/stty raw -echo"
if STDIN.respond_to?(:getbyte)
STDIN.getbyte
else
STDIN.getc
end
ensure
system "/bin/stty -raw echo"
end
def wait_for_user
puts
puts "Press RETURN to continue or any other key to abort"
# we test for \r and \n because some stuff does \r instead
# as well as Y and y
# abort unless [10, 13, 89, 121].include? getc
[10, 13, 89, 121].include? getc
end
puts "ZenFresh Installer"
puts "Setup Git? [Y/n]"
if wait_for_user
puts "yes, let's do it"
puts "Enter your name:"
`git config --global user.name "#{gets.chomp}"`
puts "Enter your email:"
`git config --global user.email "#{gets.chomp}"`
else
puts "nope, not going to happen"
end
puts "Install Homebrew? [Y/n]"
if wait_for_user
system('ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"')
end
puts "Update Homebrew? [Y/n]"
if wait_for_user
system('brew update')
end
puts "Install Homebrew packages? [Y/n]"
if wait_for_user
system('brew install htop')
puts 'Running post-installation commands'
system('sudo chown root:wheel /usr/local/Cellar/htop-osx/0.8.2.2/bin/htop')
system('sudo chmod u+s /usr/local/Cellar/htop-osx/0.8.2.2/bin/htop')
end
puts "Install wget? [Y/n]"
if wait_for_user
system('brew install wget')
end
puts "Install Homebrew Cask? [Y/n]"
if wait_for_user
system('brew install caskroom/cask/brew-cask')
system('brew cask doctor')
system('brew cask update')
end
puts "Install Cask Packages? [Y/n]"
if wait_for_user
system('brew cask install google-chrome')
system('brew cask install hipchat')
system('brew cask install atom')
system('brew cask install skype')
system('brew cask install Caskroom/cask/sequel-pro')
end
puts "Install Zsh? [Y/n]"
if wait_for_user
system('brew install zsh')
end
puts "Install Pretzo? [Y/n]"
if wait_for_user
end
puts "Install Ruby? [Y/n]"
if wait_for_user
system('brew install rbenv rbenv-gem-rehash ruby-build')
# gem update --system
# gem install bundler
# echo 'gem: --no-document' > ~/.gemrc
end
puts "Install SQLite3 [Y/n]"
if wait_for_user
system('brew install sqlite3')
end
puts "Install MySQL [Y/n]"
if wait_for_user
system('brew install mysql')
system('ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents')
system('launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist')
system('mysql_secure_installation')
end
puts "Install PostgreSQL [Y/n]"
if wait_for_user
system('brew install postgresql')
# system('ARCHFLAGS="-arch x86_64" gem install pg')
# ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
# launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
end
print "Tapping Homebrew Science..."
system('brew tap homebrew/science')
puts "done."
puts "Done"