-
Notifications
You must be signed in to change notification settings - Fork 0
/
liftoff
executable file
·78 lines (61 loc) · 2.11 KB
/
liftoff
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
#!/usr/bin/env bash
# vim: set ft=ruby:
# This file executes as a bash script, which turns around and executes Ruby via
# the line below. The -x argument to Ruby makes it discard everything before
# the second "!ruby" shebang. This allows us to work on Linux, where the
# shebang can only have one argument so we can't directly say
# "#!/usr/bin/env ruby --disable-gems". Thanks for that, Linux.
#
# If this seems confusing, don't worry. You can treat it as a normal Ruby file
# starting with the "!ruby" shebang below.
# - Gary
exec /usr/bin/env ruby --disable-gems -x "$0" $*
#!ruby
def run(cmd)
return puts cmd if ENV["TEST"]
unless system cmd
fail
end
end
def say(msg)
puts ""
puts ""
puts msg
puts ""
end
Array(1..5).reverse.each do |n|
system("clear && printf '\e[3J'")
system("cat bwlogo.txt")
puts "#{n}..."
sleep 0.75
end
say "LIFT OFF"
say "=== Installing Xcode Tools ==="
run "xcode-select --install"
say "=== Installing Homebrew ==="
run %{/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"}
say "--- Installing Homebrew Cask ---"
run "brew tap caskroom/cask"
run "brew install brew-cask"
say "=== Installing ZSH ==="
run %{sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"}
say "=== Running Setup Script ==="
run "ruby setup.rb"
say "=== Installing RVM ==="
say "---- This Might Fail ----"
say "(sorry)"
run "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB"
run "\curl -sSL https://get.rvm.io | bash -s stable --ruby --gems=bundler,pry"
say "=== Installing Magic Wormhole ==="
run "pip install -user magic-wormhole"
run %{echo "alias wormhole='~/Library/Python/2.7/bin/wormhole'" >> ~/.zshrc}
say "=== DONE! ==="
say "... calculating next steps ..."
say """
Things to do on your own:
- Install _correct_ Ruby version for your projects.
- Setup your SSH Keys
- Setup your dotfiles
- Configure your Editor
- Fix any steps that may have failed during the installation process and open a Pull Request.
"""