Documentation
¶
Overview ¶
Package fsutil holds the filesystem helpers shared by the fetchers, the renderer and the command layer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEmptyDir ¶
IsEmptyDir reports whether path is an empty directory. A missing directory counts as empty, which is what `rig new` into a fresh path wants.
func MoveDir ¶
MoveDir copies src into dst and removes src.
This is a copy rather than a rename because the staging directory lives in the system temp dir, which is routinely a different filesystem — often a tmpfs — from the user's project. A rename-only implementation would fail exactly when someone first tried the tool. The copy is cheap in practice: staging only ever holds generated files, since hooks run after the move.
func SafeJoin ¶
SafeJoin joins rel onto root and guarantees the result stays inside root. Every write rig performs goes through this: template-rendered paths and blueprint-declared paths are both attacker-controlled if you did not write the blueprint yourself, so containment cannot be left to convention.
Types ¶
This section is empty.