@@ -63,7 +63,7 @@ export class PackageDownloader {
63
63
urlExists ( url ) {
64
64
const self = this
65
65
66
- return new Promise ( ( resolve , reject ) => {
66
+ return new Promise ( ( resolve ) => {
67
67
try {
68
68
self . logger . debug ( `Checking URL: ${ url } ` )
69
69
let req
@@ -147,7 +147,7 @@ export class PackageDownloader {
147
147
* Compute hash of the file contents
148
148
* @param {string } filePath - path of the file
149
149
* @param {string } [algo] - hash algorithm
150
- * @returns {Promise<> } returns hex digest of the computed hash
150
+ * @returns {Promise<string > } returns hex digest of the computed hash
151
151
* @throws Error if the file cannot be read
152
152
*/
153
153
computeFileHash ( filePath , algo = 'sha384' ) {
@@ -249,15 +249,19 @@ export class PackageDownloader {
249
249
* @param {boolean } [force] - whether to download even if the file exists
250
250
* @returns {string } full path to the downloaded file
251
251
*/
252
- fetchPlatform ( tag , destDir , force = false ) {
252
+ async fetchPlatform ( tag , destDir , force = false ) {
253
253
if ( ! tag ) throw new MissingArgumentError ( 'tag is required' )
254
- if ( ! destDir ) throw new MissingArgumentError ( 'destination directory path is required' )
254
+ if ( ! destDir ) {
255
+ throw new MissingArgumentError (
256
+ 'destination directory path is required' )
257
+ }
255
258
256
259
const releaseDir = Templates . prepareReleasePrefix ( tag )
257
260
const downloadDir = `${ destDir } /${ releaseDir } `
258
261
const packageURL = `${ constants . HEDERA_BUILDS_URL } /node/software/${ releaseDir } /build-${ tag } .zip`
259
262
const checksumURL = `${ constants . HEDERA_BUILDS_URL } /node/software/${ releaseDir } /build-${ tag } .sha384`
260
263
261
- return this . fetchPackage ( packageURL , checksumURL , downloadDir , 'sha384' , force )
264
+ return await this . fetchPackage ( packageURL , checksumURL , downloadDir ,
265
+ 'sha384' , force )
262
266
}
263
267
}
0 commit comments