Sha256: e3372fbe8c9700417184d59b5182f153be7d891eeede9f74cf9037248619cb19

Contents?: true

Size: 567 Bytes

Versions: 5

Compression:

Stored size: 567 Bytes

Contents

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

    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 "Executing 'vagrant reload' for kontena-master"
        exit $?.exitstatus unless system('vagrant reload')
        spinner "Vagrant machine restarted"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
krates-plugin-vagrant-0.3.3 lib/kontena/plugin/vagrant/master/restart_command.rb
krates-plugin-vagrant-0.3.2 lib/kontena/plugin/vagrant/master/restart_command.rb
krates-plugin-vagrant-0.3.1 lib/kontena/plugin/vagrant/master/restart_command.rb
kontena-plugin-vagrant-0.3.1 lib/kontena/plugin/vagrant/master/restart_command.rb
kontena-plugin-vagrant-0.3.0 lib/kontena/plugin/vagrant/master/restart_command.rb