Sha256: 07a134c825c14967b72c70873556f3f575a69416d51ac27526668be64ff293db

Contents?: true

Size: 564 Bytes

Versions: 3

Compression:

Stored size: 564 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}/.krates/vagrant_master"
      abort("Cannot find Vagrant krates-master".colorize(:red)) unless Dir.exist?(vagrant_path)
      Dir.chdir(vagrant_path) do
        spinner "Executing 'vagrant reload' for krates-master"
        exit $?.exitstatus unless system('vagrant reload')
        spinner "Vagrant machine restarted"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
krates-plugin-vagrant-0.3.6 lib/kontena/plugin/vagrant/master/restart_command.rb
krates-plugin-vagrant-0.3.5 lib/kontena/plugin/vagrant/master/restart_command.rb
krates-plugin-vagrant-0.3.4 lib/kontena/plugin/vagrant/master/restart_command.rb