Skip to content

Commit 0b010bf

Browse files
dahlbyknodkz
authored andcommitted
fix: simplify postinstall path check for Windows' users
The RegExp check is failing with Windows path separators.
1 parent 1abad7c commit 0b010bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default class MongoBinary {
108108

109109
// if we're in postinstall script, npm will set the cwd too deep
110110
let nodeModulesDLDir = process.cwd();
111-
while (new RegExp(`node_modules${path.sep}mongodb-memory-server`).test(nodeModulesDLDir)) {
111+
while (nodeModulesDLDir.endsWith(`node_modules${path.sep}mongodb-memory-server`)) {
112112
nodeModulesDLDir = path.resolve(nodeModulesDLDir, '..', '..');
113113
}
114114

0 commit comments

Comments
 (0)