fix: Don't delete original disk

This commit is contained in:
Felix Rieseberg 2020-07-29 11:43:12 -07:00
parent f4c1e4dedb
commit c72e1294c6

View File

@ -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");