File tree 7 files changed +23
-4
lines changed
mongodb-memory-server-global
mongodb-memory-server-global-3.4
mongodb-memory-server-global-3.6
mongodb-memory-server-global-4.0
mongodb-memory-server-global-4.2
mongodb-memory-server-global-4.4
7 files changed +23
-4
lines changed Original file line number Diff line number Diff line change
1
+ /* eslint @typescript-eslint/no-var-requires: 0 */
2
+
1
3
function isModuleExists ( name ) {
2
4
try {
3
5
return ! ! require . resolve ( name ) ;
Original file line number Diff line number Diff line change
1
+ /* eslint @typescript-eslint/no-var-requires: 0 */
2
+
1
3
function isModuleExists ( name ) {
2
4
try {
3
5
return ! ! require . resolve ( name ) ;
Original file line number Diff line number Diff line change
1
+ /* eslint @typescript-eslint/no-var-requires: 0 */
2
+
1
3
function isModuleExists ( name ) {
2
4
try {
3
5
return ! ! require . resolve ( name ) ;
Original file line number Diff line number Diff line change
1
+ /* eslint @typescript-eslint/no-var-requires: 0 */
2
+
1
3
function isModuleExists ( name ) {
2
4
try {
3
5
return ! ! require . resolve ( name ) ;
Original file line number Diff line number Diff line change
1
+ /* eslint @typescript-eslint/no-var-requires: 0 */
2
+
1
3
function isModuleExists ( name ) {
2
4
try {
3
5
return ! ! require . resolve ( name ) ;
Original file line number Diff line number Diff line change
1
+ /* eslint @typescript-eslint/no-var-requires: 0 */
2
+
1
3
function isModuleExists ( name ) {
2
4
try {
3
5
return ! ! require . resolve ( name ) ;
Original file line number Diff line number Diff line change
1
+ /* eslint @typescript-eslint/no-var-requires: 0 */
2
+
1
3
/*
2
4
This script is used as postinstall hook.
3
5
@@ -20,19 +22,24 @@ if (!isModuleExists('../mongodb-memory-server-core/lib/util/resolve-config')) {
20
22
console . log ( 'Could not resolve postinstall configuration' ) ;
21
23
return ;
22
24
}
23
- // eslint-disable-next-line @typescript-eslint/no-var-requires
25
+
24
26
const rc = require ( '../mongodb-memory-server-core/lib/util/resolve-config' ) ;
25
27
rc . reInitializePackageJson ( process . env . INIT_CWD ) ;
26
28
27
29
const envDisablePostinstall = rc . default ( 'DISABLE_POSTINSTALL' ) ;
28
- const skipDownload =
29
- typeof envDisablePostinstall === 'string' && rc . envToBool ( envDisablePostinstall ) ;
30
30
31
- if ( skipDownload ) {
31
+ if ( typeof envDisablePostinstall === 'string' && rc . envToBool ( envDisablePostinstall ) ) {
32
32
console . log ( 'Download is skipped by MONGOMS_DISABLE_POSTINSTALL variable' ) ;
33
33
process . exit ( 0 ) ;
34
34
}
35
35
36
+ const envSystemBinary = rc . default ( 'SYSTEM_BINARY' ) ;
37
+
38
+ if ( typeof envSystemBinary === 'string' ) {
39
+ console . log ( 'Download is skipped by MONGOMS_SYSTEM_BINARY variable' ) ;
40
+ process . exit ( 0 ) ;
41
+ }
42
+
36
43
const mongoBinaryModule = '../mongodb-memory-server-core/lib/util/MongoBinary' ;
37
44
if ( isModuleExists ( mongoBinaryModule ) ) {
38
45
const MongoBinary = require ( mongoBinaryModule ) . default ;
You can’t perform that action at this time.
0 commit comments