Sha256: 7f82a6c6babf24ec54f9cc48acf1bcec7dddb260467d0d7d414caa423baf4deb

Contents?: true

Size: 819 Bytes

Versions: 22

Compression:

Stored size: 819 Bytes

Contents

module VagrantPlugins
  module FileUpload
    class Provisioner < Vagrant.plugin("2", :provisioner)
      def provision
        @machine.communicate.tap do |comm|
          destination = expand_guest_path(config.destination)

          # Make sure the remote path exists
          command = "mkdir -p %s" % File.dirname(destination)
          comm.execute(command)

          # now upload the file
          comm.upload(File.expand_path(config.source), destination)
        end
      end

      private

      # Expand the guest path if the guest has the capability
      def expand_guest_path(destination)
        if machine.guest.capability?(:shell_expand_guest_path)
          machine.guest.capability(:shell_expand_guest_path, destination)
        else
          destination
        end
      end
    end
  end
end

Version data entries

22 entries across 19 versions & 5 rubygems

Version Path
vagrant-unbundled-1.9.7.1 plugins/provisioners/file/provisioner.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/provisioners/file/provisioner.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/provisioners/file/provisioner.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/provisioners/file/provisioner.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/provisioners/file/provisioner.rb
vagrant-unbundled-1.9.5.1 plugins/provisioners/file/provisioner.rb
vagrant-unbundled-1.9.1.1 plugins/provisioners/file/provisioner.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/provisioners/file/provisioner.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/provisioners/file/provisioner.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/provisioners/file/provisioner.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/provisioners/file/provisioner.rb
vagrant-unbundled-1.8.5.2 plugins/provisioners/file/provisioner.rb
vagrant-unbundled-1.8.5.1 plugins/provisioners/file/provisioner.rb
vagrant-unbundled-1.8.4.2 plugins/provisioners/file/provisioner.rb
vagrant-unbundled-1.8.4.1 plugins/provisioners/file/provisioner.rb
vagrant-unbundled-1.8.1.2 plugins/provisioners/file/provisioner.rb
vagrant-unbundled-1.8.1.1 plugins/provisioners/file/provisioner.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/plugins/provisioners/file/provisioner.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/plugins/provisioners/file/provisioner.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/plugins/provisioners/file/provisioner.rb