aboutsummaryrefslogtreecommitdiffhomepage
path: root/system/mkdir.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-03 02:26:14 +0900
committerOphestra <cat@gensokyo.uk>2025-10-03 02:26:14 +0900
commitd16da6da8c4880d90dc35fa9006806f7c0395d7f (patch)
treed4ca8fed4e14bcffe63268daa6d8efd1923ff03b /system/mkdir.go
parente58181a930064385c881b7ee1cac4914dd435121 (diff)
system: enforce absolute paths
This is less error-prone, and is quite easy to integrate considering internal/app has already migrated to container.Absolute. Closes #11. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/mkdir.go')
-rw-r--r--system/mkdir.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/system/mkdir.go b/system/mkdir.go
index 23c42104..fc6a8306 100644
--- a/system/mkdir.go
+++ b/system/mkdir.go
@@ -5,18 +5,19 @@ import (
"fmt"
"os"
+ "hakurei.app/container"
"hakurei.app/hst"
)
// Ensure ensures the existence of a directory.
-func (sys *I) Ensure(name string, perm os.FileMode) *I {
- sys.ops = append(sys.ops, &mkdirOp{User, name, perm, false})
+func (sys *I) Ensure(name *container.Absolute, perm os.FileMode) *I {
+ sys.ops = append(sys.ops, &mkdirOp{User, name.String(), perm, false})
return sys
}
// Ephemeral ensures the existence of a directory until its [Enablement] is no longer satisfied.
-func (sys *I) Ephemeral(et hst.Enablement, name string, perm os.FileMode) *I {
- sys.ops = append(sys.ops, &mkdirOp{et, name, perm, true})
+func (sys *I) Ephemeral(et hst.Enablement, name *container.Absolute, perm os.FileMode) *I {
+ sys.ops = append(sys.ops, &mkdirOp{et, name.String(), perm, true})
return sys
}