Class: Terraspace::Terraform::Ihooks::Before::Plan

Inherits:
Terraspace::Terraform::Ihooks::Base show all
Defined in:
lib/terraspace/terraform/ihooks/before/plan.rb

Instance Method Summary collapse

Methods inherited from Terraspace::Terraform::Ihooks::Base

#initialize

Methods inherited from CLI::Base

#initialize

Methods included from Util::Pretty

#pretty_path, #pretty_time

Methods included from Util::Sure

#sure?

Methods included from Util::Logging

#logger

Constructor Details

This class inherits a constructor from Terraspace::Terraform::Ihooks::Base

Instance Method Details

#runObject



3
4
5
6
7
8
9
10
11
12
# 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