diff --git a/lib/wordpress_deploy/cli/utility.rb b/lib/wordpress_deploy/cli/utility.rb index 71d1923..94384b3 100644 --- a/lib/wordpress_deploy/cli/utility.rb +++ b/lib/wordpress_deploy/cli/utility.rb @@ -165,6 +165,29 @@ def transmit(environment) # Exit with an error exit(1) end + + desc "receive ENVIRONMENT", "" + def receive(environment) + # Set logger into verbose mode (if the user requested it) + Logger.verbose = options[:verbose] + + # Set environment options + Config.set_options options + + # Load ALL the available environments + WordpressDeploy::Environments.load + + # Get the Environment the user requested + env = WordpressDeploy::Environments.find environments.to_sym + + # Receive the files into wp_dir + + rescue => err + Logger.error Errors::Cli::Utility::Error.wrap(err) + + # Exit with an error + exit(1) + end end end end