lib/itamae/resource/directory.rb in itamae-1.3.0 vs lib/itamae/resource/directory.rb in itamae-1.3.1
- old
+ new
@@ -11,10 +11,12 @@
def pre_action
case @current_action
when :create
attributes.exist = true
+ when :delete
+ attributes.exist = false
end
end
def show_differences
current.mode = current.mode.rjust(4, '0') if current.mode
@@ -45,9 +47,15 @@
if attributes.mode
run_specinfra(:change_file_mode, attributes.path, attributes.mode)
end
if attributes.owner || attributes.group
run_specinfra(:change_file_owner, attributes.path, attributes.owner, attributes.group)
+ end
+ end
+
+ def action_delete(options)
+ if run_specinfra(:check_file_is_directory, attributes.path)
+ run_specinfra(:remove_file, attributes.path)
end
end
end
end
end