Improve temp target switching for project actions

This commit is contained in:
ViViDboarder 2013-05-01 13:21:33 -07:00
parent 8030fe5f57
commit df81c1dde8
1 changed files with 10 additions and 7 deletions

View File

@ -236,17 +236,17 @@ module AbuseTheForce
# If a new target was provided, switch to it # If a new target was provided, switch to it
if options[:target] != nil if options[:target] != nil
AbuseTheForce.temp_switch_target(options[:target]) target = options[:target]
end end
if target != nil if target != nil
AbuseTheForce.temp_switch_target(target) AbuseTheForce.temp_switch_target target
end end
# Deploy the project # Deploy the project
AbuseTheForce.deploy_project() AbuseTheForce.deploy_project()
# if using a temp target, switch back # if using a temp target, switch back
if options[:target] != nil if target != nil
AbuseTheForce.temp_switch_target AbuseTheForce.temp_switch_target
end end
end end
@ -279,7 +279,7 @@ module AbuseTheForce
# If a new target was provided, switch to it # If a new target was provided, switch to it
if options[:target] != nil if options[:target] != nil
AbuseTheForce.temp_switch_target(options[:target]) AbuseTheForce.temp_switch_target options[:target]
end end
# No metadata passed in, this should be a file path # No metadata passed in, this should be a file path
@ -318,18 +318,21 @@ module AbuseTheForce
end end
desc "project", "Retrieve a whole project" desc "project", "Retrieve a whole project"
def project() def project(target=nil)
# If a new target was provided, switch to it # If a new target was provided, switch to it
if options[:target] != nil if options[:target] != nil
AbuseTheForce.temp_switch_target options[:target] target = options[:target]
end
if target != nil
AbuseTheForce.temp_switch_target target
end end
# Retrieve the project # Retrieve the project
AbuseTheForce.retrieve_project AbuseTheForce.retrieve_project
# if using a temp target, switch back # if using a temp target, switch back
if options[:target] != nil if target != nil
AbuseTheForce.temp_switch_target AbuseTheForce.temp_switch_target
end end
end end