File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,16 @@ export default class MongoBinary {
3030 process . env ?. MONGOMS_DOWNLOAD_DIR ||
3131 ( fs . existsSync ( legacyDLDir )
3232 ? legacyDLDir
33- : path . resolve ( findCacheDir ( { name : 'mongodb-memory-server' } ) , 'mongodb-binaries' ) ) ,
33+ : path . resolve (
34+ findCacheDir ( {
35+ name : 'mongodb-memory-server' ,
36+ // if we're in postinstall script, npm will set the cwd too deep
37+ cwd : new RegExp ( `node_modules${ path . sep } mongodb-memory-server$` ) . test ( process . cwd ( ) )
38+ ? path . resolve ( process . cwd ( ) , '..' , '..' )
39+ : process . cwd ( ) ,
40+ } ) ,
41+ 'mongodb-binaries'
42+ ) ) ,
3443 platform : process . env ?. MONGOMS_PLATFORM || os . platform ( ) ,
3544 arch : process . env ?. MONGOMS_ARCH || os . arch ( ) ,
3645 version : process . env ?. MONGOMS_VERSION || 'latest' ,
You can’t perform that action at this time.
0 commit comments