🐎 Do not delete partial patch files from previous runs
This commit is contained in:
parent
f6298af4c4
commit
b277d81aa1
1 changed files with 11 additions and 6 deletions
|
@ -11,7 +11,11 @@ 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
|
||||||
|
if (true) {
|
||||||
|
resolve(false);
|
||||||
|
} else {
|
||||||
|
//file is incorrect; delete it so we can overwrite it
|
||||||
fs.unlink(fileName, function(error) {
|
fs.unlink(fileName, function(error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(error);
|
reject(error);
|
||||||
|
@ -19,6 +23,7 @@ export default function checkLocalCache(fileName: string, size: number): Promise
|
||||||
resolve(false);
|
resolve(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
resolve(false);
|
resolve(false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue