mirror of
https://github.com/actions/download-artifact.git
synced 2025-07-27 00:48:28 +02:00
move download finish to then statement
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
This commit is contained in:
parent
fdf1695da1
commit
c7a6943d3b
3 changed files with 9 additions and 11 deletions
9
dist/index.js
vendored
9
dist/index.js
vendored
|
@ -31181,10 +31181,7 @@ function doDownload(s3, s3Bucket, fileKey, localKey) {
|
||||||
core.debug(`S3 download uri: s3://${s3Bucket}/${fileKey}`);
|
core.debug(`S3 download uri: s3://${s3Bucket}/${fileKey}`);
|
||||||
const readStream = s3.getObject(getObjectParams).createReadStream();
|
const readStream = s3.getObject(getObjectParams).createReadStream();
|
||||||
readStream.pipe(writeStream);
|
readStream.pipe(writeStream);
|
||||||
readStream.on('close', () => {
|
readStream.on('close', resolve);
|
||||||
core.info(`Finished download: ${localKey}`);
|
|
||||||
resolve;
|
|
||||||
});
|
|
||||||
readStream.on('error', reject);
|
readStream.on('error', reject);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -31221,7 +31218,9 @@ function run() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const localKey = path_1.default.join(resolvedPath, fileObject.Key.replace(s3Prefix, ''));
|
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
|
// 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
|
// if no path is provided, an empty string resolves to the current working directory
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"release": "ncc build src/download-artifact.ts && git add -f dist/",
|
"release": "ncc build src/download-artifact.ts",
|
||||||
"check-all": "concurrently \"npm:format-check\" \"npm:lint\" \"npm:build\"",
|
"check-all": "concurrently \"npm:format-check\" \"npm:lint\" \"npm:build\"",
|
||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --write **/*.ts",
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
|
|
|
@ -24,10 +24,7 @@ function doDownload(
|
||||||
core.debug(`S3 download uri: s3://${s3Bucket}/${fileKey}`)
|
core.debug(`S3 download uri: s3://${s3Bucket}/${fileKey}`)
|
||||||
const readStream = s3.getObject(getObjectParams).createReadStream()
|
const readStream = s3.getObject(getObjectParams).createReadStream()
|
||||||
readStream.pipe(writeStream)
|
readStream.pipe(writeStream)
|
||||||
readStream.on('close', () => {
|
readStream.on('close', resolve)
|
||||||
core.info(`Finished download: ${localKey}`)
|
|
||||||
resolve
|
|
||||||
})
|
|
||||||
readStream.on('error', reject)
|
readStream.on('error', reject)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -67,7 +64,9 @@ async function run(): Promise<void> {
|
||||||
resolvedPath,
|
resolvedPath,
|
||||||
fileObject.Key.replace(s3Prefix, '')
|
fileObject.Key.replace(s3Prefix, '')
|
||||||
)
|
)
|
||||||
await doDownload(s3, s3Bucket, fileObject.Key, localKey)
|
await doDownload(s3, s3Bucket, fileObject.Key, localKey).then(() => {
|
||||||
|
core.info(`Finished download: ${localKey}`)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// output the directory that the artifact(s) was/were downloaded to
|
// 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
|
// if no path is provided, an empty string resolves to the current working directory
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue