Sha256: 69beb09e3d1c9024a5d8f1e15b44fa8b0a77a28e19370c9577c21f3f22b9c27f

Contents?: true

Size: 982 Bytes

Versions: 9

Compression:

Stored size: 982 Bytes

Contents

require "fileutils"

require_relative "../../../../lib/vagrant/action/general/package"

module VagrantPlugins
  module ProviderVirtualBox
    module Action
      class PackageSetupFolders
        include Vagrant::Util::Presence

        def initialize(app, env)
          @app = app
        end

        def call(env)
          env["package.output"] ||= "package.box"
          env["package.directory"] ||= Dir.mktmpdir("vagrant-package-", env[:tmp_path])

          # Match up a couple environmental variables so that the other parts of
          # Vagrant will do the right thing.
          env["export.temp_dir"] = env["package.directory"]

          Vagrant::Action::General::Package.validate!(
            env["package.output"], env["package.directory"])

          @app.call(env)
        end

        def recover(env)
          dir = env["package.directory"]
          if File.exist?(dir)
            FileUtils.rm_rf(dir)
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
vagrant-unbundled-1.9.1.1 plugins/providers/virtualbox/action/package_setup_folders.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/virtualbox/action/package_setup_folders.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/virtualbox/action/package_setup_folders.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/virtualbox/action/package_setup_folders.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/virtualbox/action/package_setup_folders.rb
vagrant-unbundled-1.8.5.2 plugins/providers/virtualbox/action/package_setup_folders.rb
vagrant-unbundled-1.8.5.1 plugins/providers/virtualbox/action/package_setup_folders.rb
vagrant-unbundled-1.8.4.2 plugins/providers/virtualbox/action/package_setup_folders.rb
vagrant-unbundled-1.8.4.1 plugins/providers/virtualbox/action/package_setup_folders.rb