Changed when file is removed
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2022-06-03 13:22:32 +02:00
parent 33049c507f
commit 3752ca2347
1 changed files with 6 additions and 4 deletions

View File

@ -48,6 +48,12 @@ module.exports = Self => {
tempDir = `${tempPath}/${fileName}`;
tempFile = `${tempPath}/${fileName}.zip`;
if (fs.existsSync(tempFile))
await fs.unlink(tempFile);
if (fs.existsSync(tempDir))
await fs.rmdir(tempDir, {recursive: true});
await extractFile({
ftpClient: ftpClient,
file: file,
@ -61,7 +67,6 @@ module.exports = Self => {
if (fs.existsSync(tempFile))
await fs.unlink(tempFile);
await fs.rmdir(tempDir, {recursive: true});
console.error(error);
}
}
@ -89,9 +94,6 @@ module.exports = Self => {
zip.extractAllTo(paths.tempDir, false);
if (fs.existsSync(paths.tempFile))
await fs.unlink(paths.tempFile);
await dumpData({file, entries, paths});
await fs.rmdir(paths.tempDir, {recursive: true});