fix: Handled mk_dir error.

This commit is contained in:
2026-06-24 13:42:29 -04:00
parent dc72ff56fd
commit de1594d9d1
2 changed files with 4 additions and 3 deletions

View File

@@ -42,7 +42,10 @@ cmd_restore :: proc(cmd: ^Command) {
}
dir := filepath.dir(file.Path)
os.mkdir_all(dir)
if err := os.mkdir_all(dir); err != nil {
fmt.wprintf(cmd.err, "failed to create directory: %s\n", err)
return
}
write_err := os.write_entire_file(file.Path, file.contents)
if write_err != nil {