move download finish to then statement

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
This commit is contained in:
Eli Uriegas 2021-05-19 15:30:55 -07:00
parent fdf1695da1
commit c7a6943d3b
No known key found for this signature in database
GPG key ID: EE2C3B4893010973
3 changed files with 9 additions and 11 deletions

9
dist/index.js vendored
View file

@ -31181,10 +31181,7 @@ function doDownload(s3, s3Bucket, fileKey, localKey) {
core.debug(`S3 download uri: s3://${s3Bucket}/${fileKey}`);
const readStream = s3.getObject(getObjectParams).createReadStream();
readStream.pipe(writeStream);
readStream.on('close', () => {
core.info(`Finished download: ${localKey}`);
resolve;
});
readStream.on('close', resolve);
readStream.on('error', reject);
});
}
@ -31221,7 +31218,9 @@ function run() {
continue;
}
const localKey = path_1.default.join(resolvedPath, fileObject.Key.replace(s3Prefix, ''));
yield doDownload(s3, s3Bucket, fileObject.Key, localKey);
yield doDownload(s3, s3Bucket, fileObject.Key, localKey).then(() => {
core.info(`Finished download: ${localKey}`);
});
}
// output the directory that the artifact(s) was/were downloaded to
// if no path is provided, an empty string resolves to the current working directory