Skip to content

Commit

Permalink
style(MongoBinaryDownload::extractTarGz): rename some variables to cu…
Browse files Browse the repository at this point in the history
…rrent convention
  • Loading branch information
hasezoey committed Aug 17, 2022
1 parent 15acdb8 commit bcb4dab
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { assertion, mkdir, pathExists } from './utils';
import { DryMongoBinary } from './DryMongoBinary';
import { MongoBinaryOpts } from './MongoBinary';
import { clearLine } from 'readline';
import { Md5CheckFailedError } from './errors';
import { GenericMMSError, Md5CheckFailedError } from './errors';

const log = debug('MongoMS:MongoBinaryDownload');

Expand Down Expand Up @@ -332,22 +332,20 @@ export class MongoBinaryDownload {
stream.resume();
});

return new Promise((resolve, reject) => {
return new Promise((res, rej) => {
createReadStream(mongoDBArchive)
.on('error', (err) => {
reject('Unable to open tarball ' + mongoDBArchive + ': ' + err);
rej('Unable to open tarball ' + mongoDBArchive + ': ' + err);
})
.pipe(createUnzip())
.on('error', (err) => {
reject('Error during unzip for ' + mongoDBArchive + ': ' + err);
rej('Error during unzip for ' + mongoDBArchive + ': ' + err);
})
.pipe(extract)
.on('error', (err) => {
reject('Error during untar for ' + mongoDBArchive + ': ' + err);
rej('Error during untar for ' + mongoDBArchive + ': ' + err);
})
.on('finish', (result) => {
resolve(result);
});
.on('finish', res);
});
}

Expand Down

0 comments on commit bcb4dab

Please sign in to comment.