Skip to content

Commit 5a71145

Browse files
committed
Applied mongodb-js#25 for Mockgoose startup on Windows
1 parent 7589912 commit 5a71145

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
dist
44
*.log
55
*.swp
6+
.idea/

index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function start_server(opts, callback) {
4242
}
4343

4444
if (opts.args.fork === undefined) {
45-
opts.args.fork = true;
45+
opts.args.fork = false;
4646
}
4747

4848
if (!opts.args.logpath) {
@@ -68,7 +68,8 @@ function start_server(opts, callback) {
6868

6969
function start() {
7070
debug("spawn", bpath + "mongod", args.join(' '));
71-
var child = spawnSync(bpath + "mongod", args);
71+
var spawn = (opts.args.fork)? spawnSync : require('child_process').spawn;
72+
var child = spawn(bpath + "mongod", args);
7273
mongodb_logs(child.stdout.toString());
7374
mongodb_logs(child.stderr.toString());
7475

0 commit comments

Comments
 (0)