We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e9ee044 + 78fdb4e commit 6264171Copy full SHA for 6264171
1 file changed
lib/puppet/type/concat_file.rb
@@ -89,6 +89,22 @@ def exists?
89
end.compact
90
end
91
92
+ # Copied from puppet's file type
93
+ # Autorequire the nearest ancestor directory found in the catalog.
94
+ autorequire(:file) do
95
+ req = []
96
+ path = Pathname.new(self[:path])
97
+ if !path.root?
98
+ # Start at our parent, to avoid autorequiring ourself
99
+ parents = path.parent.enum_for(:ascend)
100
+ if found = parents.find { |p| catalog.resource(:file, p.to_s) }
101
+ req << found.to_s
102
+ end
103
104
+
105
+ req
106
107
108
def should_content
109
return @generated_content if @generated_content
110
@generated_content = ""
0 commit comments