class Terraspace::Terraform::Ihooks::Before::Plan

Public Instance Methods

run() click to toggle source
# File lib/terraspace/terraform/ihooks/before/plan.rb, line 3
def run
  out = @options[:out]
  return unless out
  return if out =~ %r{^/} # not need to create parent dir for copy with absolute path

  out = @options[:out]
  name = out.sub("#{Terraspace.root}/",'')
  dest = "#{@mod.cache_dir}/#{name}"
  FileUtils.mkdir_p(File.dirname(dest))
end