Class: Terraspace::CLI::Commander
- Defined in:
- lib/terraspace/cli/commander.rb
Instance Method Summary collapse
- #auto_create_backend ⇒ Object
-
#initialize(name, options = {}) ⇒ Commander
constructor
A new instance of Commander.
-
#run ⇒ Object
Commander always runs Build#run.
Methods included from Util
Methods included from Util::Sure
Methods included from Util::Sh
Methods included from Util::Logging
Constructor Details
#initialize(name, options = {}) ⇒ Commander
Returns a new instance of Commander.
3 4 5 6 |
# File 'lib/terraspace/cli/commander.rb', line 3 def initialize(name, ={}) @name = name super() end |
Instance Method Details
#auto_create_backend ⇒ Object
16 17 18 19 |
# File 'lib/terraspace/cli/commander.rb', line 16 def auto_create_backend return unless @name == "apply" Terraspace::Compiler::Backend.new(@mod).create end |
#run ⇒ Object
Commander always runs Build#run
9 10 11 12 13 14 |
# File 'lib/terraspace/cli/commander.rb', line 9 def run Terraspace::Builder.new(@options).run # generate and init auto_create_backend Init.new(@options.merge(calling_command: @name)).run Terraspace::Terraform::Runner.new(@name, @options).run end |