Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

support user specified rsync excludes. #156

Merged
merged 1 commit into from
Dec 17, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/vagrant-aws/action/sync_folders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ def call(env)
env[:machine].communicate.sudo("mkdir -p '#{guestpath}'")
env[:machine].communicate.sudo(
"chown #{ssh_info[:username]} '#{guestpath}'")

#collect rsync excludes specified :rsync_excludes=>['path1',...] in synced_folder options
excludes = ['.vagrant/', 'Vagrantfile', *Array(data[:rsync_excludes])]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding a .uniq wouldn't hurt I think


# Rsync over to the guest path using the SSH info
command = [
"rsync", "--verbose", "--archive", "-z",
"--exclude", ".vagrant/", "--exclude", "Vagrantfile",
*excludes.map{|e|['--exclude', e]}.flatten,
"-e", "ssh -p #{ssh_info[:port]} -o StrictHostKeyChecking=no -i '#{ssh_info[:private_key_path]}'",
hostpath,
"#{ssh_info[:username]}@#{ssh_info[:host]}:#{guestpath}"]
Expand Down