summaryrefslogtreecommitdiff
path: root/internal/file
diff options
context:
space:
mode:
Diffstat (limited to 'internal/file')
-rw-r--r--internal/file/file.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/file/file.go b/internal/file/file.go
index b230473..ee759e0 100644
--- a/internal/file/file.go
+++ b/internal/file/file.go
@@ -4,8 +4,15 @@ import (
"crypto/sha256"
"log"
"os"
+
+ "codeberg.org/snonux/gonf/internal/resource"
)
+func HaveString(path, content string) error {
+ _ = resource.Register("File", path)
+ return have(path, []byte(content))
+}
+
func getChecksum(path string) [32]byte {
var checksum [32]byte
data, err := os.ReadFile(path)
@@ -62,7 +69,3 @@ func have(path string, content []byte) error {
return updateFromTmp(tmpPath, path, existingChecksum != newChecksum)
}
-
-func HaveString(path, content string) error {
- return have(path, []byte(content))
-}