@@ -32,36 +32,39 @@ def run
3232 elsif update && bundler
3333 update = { :bundler => bundler }
3434 end
35- definition = Bundler . definition ( update )
3635
37- Bundler ::CLI ::Common . configure_gem_version_promoter ( Bundler . definition , options ) if options [ :update ]
36+ Bundler . settings . temporary ( :frozen => false ) do
37+ definition = Bundler . definition ( update )
3838
39- options [ "remove-platform" ] . each do |platform |
40- definition . remove_platform ( platform )
41- end
39+ Bundler ::CLI ::Common . configure_gem_version_promoter ( definition , options ) if options [ :update ]
4240
43- options [ "add-platform" ] . each do |platform_string |
44- platform = Gem ::Platform . new ( platform_string )
45- if platform . to_s == "unknown"
46- Bundler . ui . warn "The platform `#{ platform_string } ` is unknown to RubyGems " \
47- "and adding it will likely lead to resolution errors"
41+ options [ "remove-platform" ] . each do |platform |
42+ definition . remove_platform ( platform )
4843 end
49- definition . add_platform ( platform )
50- end
5144
52- if definition . platforms . empty?
53- raise InvalidOption , "Removing all platforms from the bundle is not allowed"
54- end
45+ options [ "add-platform" ] . each do |platform_string |
46+ platform = Gem ::Platform . new ( platform_string )
47+ if platform . to_s == "unknown"
48+ Bundler . ui . warn "The platform `#{ platform_string } ` is unknown to RubyGems " \
49+ "and adding it will likely lead to resolution errors"
50+ end
51+ definition . add_platform ( platform )
52+ end
5553
56- definition . resolve_remotely! unless options [ :local ]
54+ if definition . platforms . empty?
55+ raise InvalidOption , "Removing all platforms from the bundle is not allowed"
56+ end
57+
58+ definition . resolve_remotely! unless options [ :local ]
5759
58- if print
59- puts definition . to_lock
60- else
61- file = options [ :lockfile ]
62- file = file ? File . expand_path ( file ) : Bundler . default_lockfile
63- puts "Writing lockfile to #{ file } "
64- definition . lock ( file )
60+ if print
61+ puts definition . to_lock
62+ else
63+ file = options [ :lockfile ]
64+ file = file ? File . expand_path ( file ) : Bundler . default_lockfile
65+ puts "Writing lockfile to #{ file } "
66+ definition . lock ( file )
67+ end
6568 end
6669
6770 Bundler . ui . level = previous_ui_level
0 commit comments