jpictl: create machine directories on jpictl write

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-10-28 20:42:16 +00:00
parent 9ab7594bcc
commit d036abd816
2 changed files with 27 additions and 0 deletions
+8
View File
@@ -89,3 +89,11 @@ func (m *Machine) getFilename(name string, args ...any) string {
return filepath.Join(s...)
}
// MkdirAll creates the directory representing this [Machine]
func (m *Machine) MkdirAll() error {
base := m.zone.zones.dir
fullName := m.getFilename(".")
return fs.MkdirAll(base, fullName, 0755)
}