summaryrefslogtreecommitdiff
path: root/lib/dslkeywords
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-02-18 15:34:35 +0200
committerPaul Buetow <paul@buetow.org>2025-02-18 15:34:35 +0200
commit06ce663886c56b96ef25b31f0463e2207f7321fd (patch)
treef1d07445c1680d0e6737c15bdd0020c7b9126bd1 /lib/dslkeywords
parentfdbd63c6798c6c92b482d03b1f197cbeb41a5448 (diff)
add support to delete a file
Diffstat (limited to 'lib/dslkeywords')
-rw-r--r--lib/dslkeywords/file.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/dslkeywords/file.rb b/lib/dslkeywords/file.rb
index 020a97f..41b8cd7 100644
--- a/lib/dslkeywords/file.rb
+++ b/lib/dslkeywords/file.rb
@@ -56,6 +56,11 @@ module RCM
return unless super
return evaluate_ensure_line! unless @ensure_line.nil?
+ if @is == :absent
+ ::File.delete(@file_path) if ::File.exist?(@file_path)
+ return
+ end
+
write!(real_content)
end