🎨 Even for newly added files, use .tmp file extension
This commit is contained in:
parent
110be7f94c
commit
69759e5709
1 changed files with 9 additions and 2 deletions
|
@ -83,13 +83,20 @@ export default async function getPatch({ product, from, to, sourceDirectory, tar
|
|||
try {
|
||||
//create file write stream
|
||||
const outputName = path.join(targetDir, file.name);
|
||||
await createDirRecursively(path.dirname(outputName));
|
||||
const outputStream = fs.createWriteStream(outputName);
|
||||
const outputNameTemp = path.join(targetDir, `${file.name}.tmp`);
|
||||
await createDirRecursively(path.dirname(outputNameTemp));
|
||||
const outputStream = fs.createWriteStream(outputNameTemp);
|
||||
|
||||
//start installation
|
||||
await launch(diskFilenames[file.diskNumberStart], file.offset, file.compressedSize, file.decryptionKeys, undefined, outputStream);
|
||||
|
||||
outputStream.close();
|
||||
|
||||
fs.rename(outputNameTemp, outputName, (renameError) => {
|
||||
if (renameError) {
|
||||
throw new Error(`Could not rename output file "${outputNameTemp}": ${renameError.name}`);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Could not extract file "${file.name}"`, error);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue