Skip to content

Commit f8c2f05

Browse files
committed
style(MongoBinaryDownload::makeMD5Check): change variable names to better represent what they do
1 parent ac854c9 commit f8c2f05

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,18 +196,18 @@ export class MongoBinaryDownload {
196196
return undefined;
197197
}
198198

199-
const mongoDBArchiveMd5 = await this.download(urlForReferenceMD5);
200-
const signatureContent = (await fspromises.readFile(mongoDBArchiveMd5)).toString('utf-8');
199+
const archiveMD5Path = await this.download(urlForReferenceMD5);
200+
const signatureContent = (await fspromises.readFile(archiveMD5Path)).toString('utf-8');
201201
const regexMatch = signatureContent.match(/^\s*([\w\d]+)\s*/i);
202-
const md5Remote = regexMatch ? regexMatch[1] : null;
203-
const md5Local = md5File.sync(mongoDBArchive);
204-
log(`makeMD5check: Local MD5: ${md5Local}, Remote MD5: ${md5Remote}`);
202+
const md5SigRemote = regexMatch ? regexMatch[1] : null;
203+
const md5SigLocal = md5File.sync(mongoDBArchive);
204+
log(`makeMD5check: Local MD5: ${md5SigLocal}, Remote MD5: ${md5SigRemote}`);
205205

206-
if (md5Remote !== md5Local) {
207-
throw new Md5CheckFailedError(md5Local, md5Remote || 'unknown');
206+
if (md5SigRemote !== md5SigLocal) {
207+
throw new Md5CheckFailedError(md5SigLocal, md5SigRemote || 'unknown');
208208
}
209209

210-
await fspromises.unlink(mongoDBArchiveMd5);
210+
await fspromises.unlink(archiveMD5Path);
211211

212212
return true;
213213
}

0 commit comments

Comments
 (0)