fix: don't create un-needed save file
If we don't know if we support a game's save type yet, avoid creating a file for it.
This commit is contained in:
parent
a93b335dea
commit
2d8fa9c2f7
|
@ -102,11 +102,11 @@ pub const Backup = struct {
|
||||||
const file_path = try self.getSaveFilePath(path);
|
const file_path = try self.getSaveFilePath(path);
|
||||||
defer self.alloc.free(file_path);
|
defer self.alloc.free(file_path);
|
||||||
|
|
||||||
const file = try std.fs.createFileAbsolute(file_path, .{});
|
|
||||||
defer file.close();
|
|
||||||
|
|
||||||
switch (self.kind) {
|
switch (self.kind) {
|
||||||
.Sram => {
|
.Sram => {
|
||||||
|
const file = try std.fs.createFileAbsolute(file_path, .{});
|
||||||
|
defer file.close();
|
||||||
|
|
||||||
try file.writeAll(self.buf);
|
try file.writeAll(self.buf);
|
||||||
log.info("Dumped SRAM to {s}", .{file_path});
|
log.info("Dumped SRAM to {s}", .{file_path});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue