🐎 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,7 +11,11 @@ export default function checkLocalCache(fileName: string, size: number): Promise
if (fileStats.size === size) {
resolve(true);
} else {
//delete file so we can overwrite it
//TODO: use checksum to verify that file is correct
if (true) {
resolve(false);
} else {
//file is incorrect; delete it so we can overwrite it
fs.unlink(fileName, function(error) {
if (error) {
reject(error);
@ -19,6 +23,7 @@ export default function checkLocalCache(fileName: string, size: number): Promise
resolve(false);
});
}
}
} else {
resolve(false);
}