Sha256: 4d456d6391859426ae3111b7036d4a88d93880292d12766e219b866a99ddb602

Contents?: true

Size: 926 Bytes

Versions: 47

Compression:

Stored size: 926 Bytes

Contents

require "fileutils"
require_relative "package"

module Vagrant
  module Action
    module General
      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

47 entries across 43 versions & 5 rubygems

Version Path
vagrant-unbundled-2.3.6.0 lib/vagrant/action/general/package_setup_folders.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.3.3.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.3.2.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.19.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.18.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.16.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.14.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.10.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.9.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.8.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.7.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.6.2 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.6.1 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.6.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.5.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.4.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.3.0 lib/vagrant/action/general/package_setup_folders.rb
vagrant-unbundled-2.2.2.0 lib/vagrant/action/general/package_setup_folders.rb