Class: Space::Architect::CLI::Architect::Provision

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/space_architect/cli/architect.rb

Instance Method Summary collapse

Methods inherited from BaseCommand

commit_message_options, phase

Instance Method Details

#call(iteration:, space: nil, base: nil, lane: nil, force: false, **opts) ⇒ Object



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/space_architect/cli/architect.rb', line 384

def call(iteration:, space: nil, base: nil, lane: nil, force: false, **opts)
  setup_terminal(**opts.slice(:color, :colors))
  handle_errors do
    render(store.find(space)) do |sp|
      project = ArchitectProject.new(space: sp)
      results = project.provision(iteration, base: base, lane: lane, force: force)
      if results.empty?
        terminal.say "No declared lanes to provision for '#{iteration}'"
      else
        results.each do |r|
          state = r[:created] ? "created" : "already present"
          terminal.say "#{r[:lane]}: #{terminal.path(r[:worktree])} (#{state})"
        end
      end
      CLI.record_outcome(Outcome.new(exit_code: 0))
    end
  end
end