make penchant gemfile pass through to bundler when possible, for drop-in replacement
This commit is contained in:
parent
7f97c10cd3
commit
2a29b24477
13
bin/penchant
13
bin/penchant
@ -26,8 +26,17 @@ class PenchantCLI < Thor
|
||||
|
||||
desc "gemfile ENV", "Switch the gemfile environment, or rebuild the current environment if not given"
|
||||
def gemfile(env = get_current_env)
|
||||
puts "[penchant] Rebunding for #{env} environment..."
|
||||
Penchant::Gemfile.do_full_env_switch!(env)
|
||||
if env
|
||||
puts "[penchant] Rebunding for #{env} environment..."
|
||||
!Penchant::Gemfile.do_full_env_switch!(env)
|
||||
end
|
||||
|
||||
gemfile = Penchant::Gemfile.new
|
||||
if !gemfile.has_gemfile?
|
||||
puts "No Gemfile or Gemfile.erb, exiting."
|
||||
exit 1
|
||||
end
|
||||
system %{bundle}
|
||||
end
|
||||
|
||||
desc "gemfile-env", "Get the gemfile environment"
|
||||
|
@ -8,12 +8,10 @@ module Penchant
|
||||
def do_full_env_switch!(env)
|
||||
gemfile = Penchant::Gemfile.new
|
||||
if !gemfile.has_gemfile_erb?
|
||||
puts "Not using Gemfile.erb, exiting."
|
||||
return false
|
||||
end
|
||||
|
||||
gemfile.switch_to!(env)
|
||||
system %{bundle}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -4,6 +4,7 @@ require 'rubygems'
|
||||
require 'penchant'
|
||||
|
||||
if Penchant::Gemfile.do_full_env_switch!(ARGV[0])
|
||||
system %{bundle}
|
||||
puts "Gemfile switched to #{ARGV[0]}"
|
||||
else
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user