mirror of
https://github.com/felixrieseberg/macintosh.js.git
synced 2024-12-28 02:32:13 +00:00
fix: Don't delete original disk
This commit is contained in:
parent
f4c1e4dedb
commit
c72e1294c6
@ -342,7 +342,6 @@ self.onmessage = async function (msg) {
|
||||
if (msg && msg.data === "disk_save") {
|
||||
const diskData = Module.FS.readFile("/disk");
|
||||
const diskPath = getUserDataDiskPath();
|
||||
const basiliskDiskPath = path.join(__dirname, "disk");
|
||||
|
||||
// I wish we could do this with promises, but OOM crashes kill that idea
|
||||
try {
|
||||
@ -353,14 +352,6 @@ self.onmessage = async function (msg) {
|
||||
console.error(`Failed to write disk`, error);
|
||||
}
|
||||
|
||||
try {
|
||||
if (fs.existsSync(basiliskDiskPath) && !(Module && Module.isDevMode)) {
|
||||
fs.unlinkSync(basiliskDiskPath);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Failed to delete ${basiliskDiskPath}`);
|
||||
}
|
||||
|
||||
// Now, user files
|
||||
console.log(`Saving user files`);
|
||||
await saveFilesInPath("/macintosh.js");
|
||||
|
Loading…
Reference in New Issue
Block a user