Sha256: a346c20e442c0ffd15d184d026f8978d7bb62ca113425049426e6b329a2ff020
Contents?: true
Size: 644 Bytes
Versions: 34
Compression:
Stored size: 644 Bytes
Contents
require 'fileutils' module RubyTerraform module Commands class Clean attr_reader :logger def initialize(directory: nil, logger: nil) @directory = directory ? directory : '.terraform' @logger = logger || RubyTerraform.configuration.logger end def execute(opts = {}) directory = opts[:directory] || @directory begin logger.info "Cleaning terraform directory '#{directory}'." FileUtils.rm_r(directory, :secure => true) rescue Errno::ENOENT => e logger.error "Couldn't clean '#{directory}': #{e.message}" end end end end end
Version data entries
34 entries across 34 versions & 1 rubygems