summaryrefslogtreecommitdiff
path: root/internal/resource/file/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/resource/file/file.go')
-rw-r--r--internal/resource/file/file.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/resource/file/file.go b/internal/resource/file/file.go
index ea443a9..50ba6e3 100644
--- a/internal/resource/file/file.go
+++ b/internal/resource/file/file.go
@@ -211,8 +211,11 @@ func ensureAbsent(path string) error {
// registering it. Used by other resource packages (e.g. dir) to write an
// individual file without it becoming its own top-level resource.
func Ensure(path string, opts ...opt.Option) error {
- _, err := build(path, opts...)
- return err
+ f, err := build(path, opts...)
+ if err != nil {
+ return err
+ }
+ return f.apply()
}
func Have(path string, opts ...opt.Option) resource.Resource {