summaryrefslogtreecommitdiff
path: root/internal/resource/file/file.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-05 11:25:57 +0300
committerPaul Buetow <paul@buetow.org>2026-07-05 11:25:57 +0300
commit4c5b95d5e3811025e2148a6f2a059738e79ca2c9 (patch)
treee0aaaef14e1ed6fc0d78c460b671289e39e94c73 /internal/resource/file/file.go
parent5256a4d1e5a56510758bfac710ba2ad2a45af66e (diff)
add tests for repository's Apply
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 {