File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1212version = ARGV [ 0 ]
1313
1414unless version
15- puts "usage: ./script/#{ __FILE__ } VERSION"
15+ puts "USAGE: ./script/#{ __FILE__ } VERSION [OPTIONS]"
16+ puts
17+ puts "Options:"
18+ puts " --clobber Add this flag to remove the existing Gemfile.lock before running"
1619 exit ( 1 )
1720end
1821
@@ -26,7 +29,13 @@ gem_lock_file = "#{gem_lock_dir}/Gemfile-#{version}.lock"
2629# Ensure our lock dir is created
2730cmd "mkdir #{ gem_lock_dir } " unless File . exists? ( gem_lock_dir )
2831
32+ # --clobber passed in
33+ if File . exists? ( gem_lock_file ) && ARGV . include? ( '--clobber' )
34+ cmd "rm #{ gem_lock_file } "
35+ end
36+
2937unless File . exists? ( gem_lock_file )
38+ # Generate it
3039 cmd "rm Gemfile.lock" if file_or_symlink? ( "Gemfile.lock" )
3140 cmd "export RAILS=#{ version } && bundle install"
3241 cmd "mv Gemfile.lock #{ gem_lock_file } "
You can’t perform that action at this time.
0 commit comments