Sha256: fd7e22c24e6ef0336d4265dad668a8e2fe23e9e8fdb13cbd9c0c88553976b39f

Contents?: true

Size: 674 Bytes

Versions: 2

Compression:

Stored size: 674 Bytes

Contents

module Kontena::Plugin::Vagrant::Master
  class StopCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::ShellSpinner

    def execute
      require_relative '../../../machine/vagrant'
      
      vagrant_path = "#{Dir.home}/.kontena/vagrant_master"
      abort("Cannot find Vagrant kontena-master".colorize(:red)) unless Dir.exist?(vagrant_path)
      Dir.chdir(vagrant_path) do
        spinner "Stopping Vagrant kontena-master " do
          Open3.popen2('vagrant halt') do |stdin, output, wait|
            while o = output.gets
              print o if ENV['DEBUG']
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kontena-plugin-vagrant-0.2.0 lib/kontena/plugin/vagrant/master/stop_command.rb
kontena-plugin-vagrant-0.2.0.pre2 lib/kontena/plugin/vagrant/master/stop_command.rb