run bundle update if it's needed, with the option to turn that off

This commit is contained in:
John Bintz 2012-08-07 10:55:55 -04:00
parent b29794152f
commit df0154a225
2 changed files with 8 additions and 1 deletions

View File

@ -41,6 +41,7 @@ class PenchantCLI < Thor
method_options :deployment => false method_options :deployment => false
method_options :switch_back => false method_options :switch_back => false
method_options :no_auto_update => false
desc "gemfile ENV", "Switch the gemfile environment, or rebuild the current environment if not given" desc "gemfile ENV", "Switch the gemfile environment, or rebuild the current environment if not given"
def gemfile(env = get_current_env) def gemfile(env = get_current_env)
check_git_hooks! check_git_hooks!
@ -62,7 +63,13 @@ class PenchantCLI < Thor
puts "No Gemfile or Gemfile.penchant, exiting." puts "No Gemfile or Gemfile.penchant, exiting."
exit 1 exit 1
end end
system %{bundle} system %{bundle}
# it's asking for bundle update, we know what we're doing
if $?.exitstatus == 6 and !options[:no_auto_update]
system %{bundle update}
end
end end
desc "gemfile-env", "Get the gemfile environment" desc "gemfile-env", "Get the gemfile environment"

View File

@ -1,3 +1,3 @@
module Penchant module Penchant
VERSION = "0.2.15" VERSION = "0.2.16"
end end