forked from sigmavirus24/developer.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.rb
More file actions
executable file
·40 lines (36 loc) · 1.17 KB
/
bootstrap.rb
File metadata and controls
executable file
·40 lines (36 loc) · 1.17 KB
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
#!/usr/bin/env ruby
#/ Usage: script/bootstrap [<options>]
#/ Bootstraps the gem environment.
#/
#/ Options are passed through to the bundle-install command. In most cases you
#/ won't need these. They're used primarily in production environments.
#
# =============================================================================
# Uses bundler to install all gems specified in the Gemfile.
#
# show usage message with --help
if ARGV.include?('--help')
system "grep '^#/' <'#{__FILE__}' |cut -c4-"
exit 2
end
# go into the project root because it makes everything easier
root = File.expand_path('../..', __FILE__)
Dir.chdir(root)
# bring in rubygems and make sure bundler is installed.
require 'rubygems'
begin
require 'bundler'
rescue LoadError => boom
warn "Bundler not found. Install it with `gem install bundler' and try again."
exit 1
end
# run bundle-install to install any missing gems
argv = ['--no-color', 'install']
argv += ARGV
system("bundle", *argv) || begin
if $?.exitstatus == 127
warn "bundle executable not found. Ensure bundler is installed (`gem " +
"install bundler`) and that the gem bin path is in your PATH"
end
exit($?.exitstatus)
end