Sha256: 84747f0b68beb7a8c78f1954eb9d66c9ba3c5bcc40dc9535876c35cc344dbb82

Contents?: true

Size: 556 Bytes

Versions: 4

Compression:

Stored size: 556 Bytes

Contents

class Terraspace::CLI
  class Down < Base
    include TfcConcern
    include Concerns::PlanPath

    def run
      plan if @options[:yes] && !tfc?
      destroy
    end

  private
    def plan
      if Terraspace.cloud? && !@options[:out]
        @options[:out] = plan_path
      end
      Commander.new("plan", @options.merge(destroy: true)).run
    end

    def destroy
      Commander.new("destroy", @options.merge(command: "down")).run
      Terraspace::Terraform::Tfc::Workspace.new(@options).destroy if @options[:destroy_workspace]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
terraspace-2.0.3 lib/terraspace/cli/down.rb
terraspace-2.0.2 lib/terraspace/cli/down.rb
terraspace-2.0.1 lib/terraspace/cli/down.rb
terraspace-2.0.0 lib/terraspace/cli/down.rb