Skip to content
Open
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
6 changes: 4 additions & 2 deletions lib/itamae/resource/remote_directory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class RemoteDirectory < Base
define_attribute :mode, type: String
define_attribute :owner, type: String
define_attribute :group, type: String
define_attribute :recursive_mode, type: [TrueClass, FalseClass], default: false
define_attribute :recursive_owner_and_group, type: [TrueClass, FalseClass], default: false

def pre_action
directory = ::File.expand_path(attributes.source, ::File.dirname(@recipe.path))
Expand Down Expand Up @@ -56,10 +58,10 @@ def show_differences

def action_create(options)
if attributes.mode
run_specinfra(:change_file_mode, @temppath, attributes.mode)
run_specinfra(:change_file_mode, @temppath, attributes.mode, recursive: attributes.recursive_mode)
end
if attributes.owner || attributes.group
run_specinfra(:change_file_owner, @temppath, attributes.owner, attributes.group)
run_specinfra(:change_file_owner, @temppath, attributes.owner, attributes.group, recursive: attributes.recursive_owner_and_group)
end

if run_specinfra(:check_file_is_file, attributes.path)
Expand Down