Skip to content

Commit 6210bf1

Browse files
Karan NagpalKaran Nagpal
authored andcommitted
clean up malformed zips
1 parent 8bdf184 commit 6210bf1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/helpers/buildArtifacts.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ const parseAndDownloadArtifacts = async (buildId, data) => {
2828
let fileName = 'build_artifacts.zip';
2929
BUILD_ARTIFACTS_TOTAL_COUNT += 1;
3030
all_promises.push(downloadAndUnzip(filePath, fileName, data[comb][sessionId]).catch((error) => {
31-
BUILD_ARTIFACTS_FAIL_COUNT = BUILD_ARTIFACTS_FAIL_COUNT + 1;
32-
reject(error);
31+
BUILD_ARTIFACTS_FAIL_COUNT += 1;
32+
// delete malformed zip if present
33+
let tmpFilePath = path.join(filePath, fileName);
34+
if(fs.existsSync(tmpFilePath)){
35+
fs.unlinkSync(tmpFilePath);
36+
}
3337
}));
3438
}
3539
}

0 commit comments

Comments
 (0)