Class: TerraspaceBundler::Runner

Inherits:
CLI::Base show all
Defined in:
lib/terraspace_bundler/runner.rb

Instance Method Summary collapse

Methods inherited from CLI::Base

#initialize, #set_config!

Constructor Details

This class inherits a constructor from TerraspaceBundler::CLI::Base

Instance Method Details

#export_pathsObject



21
22
23
24
25
# File 'lib/terraspace_bundler/runner.rb', line 21

def export_paths
  export_paths = Terrafile.instance.mods.map(&:export_to).compact.uniq
  export_paths << TB.config.export_to
  export_paths
end

#finish_messageObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/terraspace_bundler/runner.rb', line 9

def finish_message
  no_modules_found = true
  export_paths.each do |path|
    found = Dir.exist?(path) && !Dir.empty?(path)
    next unless found
    logger.info  "Modules saved to #{path}"
    no_modules_found = false
  end

  logger.info("No modules were found.") if no_modules_found
end

#runObject



3
4
5
6
7
# File 'lib/terraspace_bundler/runner.rb', line 3

def run
  Syncer.new(@options).run
  Exporter.new(@options).run
  finish_message
end