Sha256: f9548f4c7381129ded294597f122850cc47e4f8cda7138d03389f9d67811f473

Contents?: true

Size: 927 Bytes

Versions: 2

Compression:

Stored size: 927 Bytes

Contents

module AcquiaToolbelt
  class CLI
    class Files < AcquiaToolbelt::Thor
      desc "copy", "Copy files from one environment to another."
       method_option :origin, :type => :string, :aliases => %w(-o), :required => true,
        :desc => "Source environment for the file copy."
      method_option :target, :type => :string, :aliases => %w(-t), :required => true,
        :desc => "Target environment for the file copy."
      def copy
        if options[:subscription]
          subscription = options[:subscription]
        else
          subscription = AcquiaToolbelt::CLI::API.default_subscription
        end

        source    = options[:origin]
        target    = options[:target]
        file_copy = AcquiaToolbelt::CLI::API.request "sites/#{subscription}/files-copy/#{source}/#{target}", "POST"
        ui.success "File copy from #{source} to #{target} has started." if file_copy["id"]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acquia_toolbelt-2.0.1 lib/acquia_toolbelt/cli/file.rb
acquia_toolbelt-2.0.0 lib/acquia_toolbelt/cli/file.rb