system: enforce absolute paths
All checks were successful
Test / Create distribution (push) Successful in 1m17s
Test / Sandbox (push) Successful in 2m56s
Test / Hakurei (push) Successful in 3m54s
Test / Hpkg (push) Successful in 4m51s
Test / Sandbox (race detector) (push) Successful in 5m3s
Test / Hakurei (race detector) (push) Successful in 6m0s
Test / Flake checks (push) Successful in 1m38s
All checks were successful
Test / Create distribution (push) Successful in 1m17s
Test / Sandbox (push) Successful in 2m56s
Test / Hakurei (push) Successful in 3m54s
Test / Hpkg (push) Successful in 4m51s
Test / Sandbox (race detector) (push) Successful in 5m3s
Test / Hakurei (race detector) (push) Successful in 6m0s
Test / Flake checks (push) Successful in 1m38s
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>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user