mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-06-05 06:43:06 -04:00
Remove customized require behaviors and modify the bin executable to check for missing tools that Vagrant expects to exist when running outside of an installer.
36 lines
1.1 KiB
Ruby
36 lines
1.1 KiB
Ruby
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
require 'json'
|
|
require 'optparse'
|
|
|
|
require_relative "push_shared"
|
|
|
|
module VagrantPlugins
|
|
module CommandSnapshot
|
|
module Command
|
|
class Push < Vagrant.plugin("2", :command)
|
|
include PushShared
|
|
|
|
def execute
|
|
opts = OptionParser.new do |o|
|
|
o.banner = "Usage: vagrant snapshot push [options] [vm-name]"
|
|
o.separator ""
|
|
o.separator "Take a snapshot of the current state of the machine and 'push'"
|
|
o.separator "it onto the stack of states. You can use `vagrant snapshot pop`"
|
|
o.separator "to restore back to this state at any time."
|
|
o.separator ""
|
|
o.separator "If you use `vagrant snapshot save` or restore at any point after"
|
|
o.separator "a push, pop will still bring you back to this pushed state."
|
|
end
|
|
|
|
# Parse the options
|
|
argv = parse_options(opts)
|
|
return if !argv
|
|
|
|
return shared_exec(argv, method(:push))
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|