Sha256: 7b8fdd120443d72c47cd6aa607784dc99a214e4b114ac2f8a7015b5fb5a6cc4d
Contents?: true
Size: 1.09 KB
Versions: 18
Compression:
Stored size: 1.09 KB
Contents
# frozen_string_literal: true require 'log4r' require 'vagrant/util/subprocess' require 'vagrant/util/which' require_relative 'action/scp_sync' module VagrantPlugins module ScpSync # This Class prepares the environment for SCP Sync class SyncedFolder < Vagrant.plugin('2', :synced_folder) include Vagrant::Util def initialize(*args) super @logger = Log4r::Logger.new('vagrant_scp_sync') end def usable?(_machine, *args) scp_path = Which.which('scp') return true if scp_path return false unless args.include?(:raise_error) && args[:raise_error] raise Vagrant::Errors::SCPNotFound end def prepare(machine, folders, opts); end def enable(machine, folders, _opts) ssh_info = machine.ssh_info scp_path = Which.which('scp') machine.ui.warn(I18n.t('vagrant.scp_ssh_password')) if ssh_info[:private_key_path].empty? && ssh_info[:password] folders.each_value do |folder_opts| ScpSyncHelper.scp_single(machine, folder_opts, scp_path) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems