🐎 Do not delete partial patch files from previous runs

This commit is contained in:
C-3PO 2018-11-16 17:34:57 +01:00
parent f6298af4c4
commit b277d81aa1
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -11,13 +11,18 @@ export default function checkLocalCache(fileName: string, size: number): Promise
if (fileStats.size === size) { if (fileStats.size === size) {
resolve(true); resolve(true);
} else { } else {
//delete file so we can overwrite it //TODO: use checksum to verify that file is correct
fs.unlink(fileName, function(error) { if (true) {
if (error) {
reject(error);
}
resolve(false); resolve(false);
}); } else {
//file is incorrect; delete it so we can overwrite it
fs.unlink(fileName, function(error) {
if (error) {
reject(error);
}
resolve(false);
});
}
} }
} else { } else {
resolve(false); resolve(false);