Sha256: 84dade5d987ade32e565cb5b990eb50bbb497af6d4427279f8a4c78b26810bda

Contents?: true

Size: 665 Bytes

Versions: 5

Compression:

Stored size: 665 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Grids
  class UseCommand < Kontena::Command
    include Kontena::Cli::Common
    include Common

    requires_current_master

    parameter "NAME", "Grid name to use"

    option ['--silent'], :flag, 'Reduce output verbosity'

    def execute
      grid = find_grid_by_name(name)
      unless grid
        abort "Could not resolve grid by name [#{name}]. For a list of existing grids please run: kontena grid list".colorize(:red)
      end
      config.current_master.grid = grid['name']
      config.write
      unless self.silent?
        puts "Using grid: #{pastel.cyan(grid['name'])}"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kontena-cli-0.16.0.pre5 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.16.0.pre4 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.16.0.pre3 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.16.0.pre2 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.16.0.pre1 lib/kontena/cli/grids/use_command.rb