Sha256: b06351ce80081c67295225dada45e17690eacf3009aba956d3c9be78dc8c0432

Contents?: true

Size: 706 Bytes

Versions: 7

Compression:

Stored size: 706 Bytes

Contents

require 'fileutils'

module Kontena
  module Machine
    module Vagrant
      class MasterDestroyer

        include Kontena::Cli::ShellSpinner

        def run!
          vagrant_path = "#{Dir.home}/.kontena/vagrant_master"
          Dir.chdir(vagrant_path) do
            spinner "Terminating Kontena Master from Vagrant " do
              Open3.popen2('vagrant destroy -f') do |stdin, output, wait|
                while o = output.gets
                  puts o if ENV['DEBUG']
                end
                if wait.value == 0
                  FileUtils.remove_entry_secure(vagrant_path)
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kontena-plugin-vagrant-0.2.7 lib/kontena/machine/vagrant/master_destroyer.rb
kontena-plugin-vagrant-0.2.6 lib/kontena/machine/vagrant/master_destroyer.rb
kontena-plugin-vagrant-0.2.5 lib/kontena/machine/vagrant/master_destroyer.rb
kontena-plugin-vagrant-0.2.2 lib/kontena/machine/vagrant/master_destroyer.rb
kontena-plugin-vagrant-0.2.1 lib/kontena/machine/vagrant/master_destroyer.rb
kontena-plugin-vagrant-0.2.0 lib/kontena/machine/vagrant/master_destroyer.rb
kontena-plugin-vagrant-0.2.0.pre2 lib/kontena/machine/vagrant/master_destroyer.rb