File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ exec $0 .rb " $@ "
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env ruby
2+ #/ Usage: script/bootstrap [<options>]
3+ #/ Bootstraps the gem environment.
4+ #/
5+ #/ Options are passed through to the bundle-install command. In most cases you
6+ #/ won't need these. They're used primarily in production environments.
7+ #
8+ # =============================================================================
9+ # Uses bundler to install all gems specified in the Gemfile.
10+ #
11+ # show usage message with --help
12+ if ARGV . include? ( '--help' )
13+ system "grep '^#/' <'#{ __FILE__ } ' |cut -c4-"
14+ exit 2
15+ end
16+
17+ # go into the project root because it makes everything easier
18+ root = File . expand_path ( '../..' , __FILE__ )
19+ Dir . chdir ( root )
20+
21+ # bring in rubygems and make sure bundler is installed.
22+ require 'rubygems'
23+ begin
24+ require 'bundler'
25+ rescue LoadError => boom
26+ warn "Bundler not found. Install it with `gem install bundler' and try again."
27+ exit 1
28+ end
29+
30+ # run bundle-install to install any missing gems
31+ argv = [ '--no-color' , 'install' ]
32+ argv += ARGV
33+ system ( "bundle" , *argv ) || begin
34+ if $?. exitstatus == 127
35+ warn "bundle executable not found. Ensure bundler is installed (`gem " +
36+ "install bundler`) and that the gem bin path is in your PATH"
37+ end
38+ exit ( $?. exitstatus )
39+ end
40+
You can’t perform that action at this time.
0 commit comments