Skip to content
This repository was archived by the owner on Feb 11, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions lib/vagrant-aws/action/sync_folders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ def call(env)
:hostpath => hostpath,
:guestpath => guestpath))

# Create the host path if it doesn't exist
begin
FileUtils::mkdir_p(hostpath)
rescue => err
raise Errors::MkdirError,
:hostpath => hostpath,
:err => err
end

# Create the guest path
env[:machine].communicate.sudo("mkdir -p '#{guestpath}'")
env[:machine].communicate.sudo(
Expand Down
4 changes: 4 additions & 0 deletions lib/vagrant-aws/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class FogError < VagrantAWSError
class RsyncError < VagrantAWSError
error_key(:rsync_error)
end

class MkdirError < VagrantAWSError
error_key(:mkdir_error)
end
end
end
end
8 changes: 7 additions & 1 deletion locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,18 @@ en:

%{message}
rsync_error: |-
There was an error when attemping to rsync a share folder.
There was an error when attempting to rsync a share folder.
Please inspect the error message below for more info.

Host path: %{hostpath}
Guest path: %{guestpath}
Error: %{stderr}
mkdir_error: |-
There was an error when attempting to create a shared host folder.
Please inspect the error message below for more info.

Host path: %{hostpath}
Error: %{err}

states:
short_not_created: |-
Expand Down