Skip to content

Commit f435796

Browse files
committed
Switch from spawn to fork.
Learn something new every day.
1 parent 1101e14 commit f435796

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/db-migrate-wrapper.js

100755100644
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env node
2-
31
/**
42
* db-migrate doesn't provide a programmatic interface. Or at least there's a lot of work in the
53
* bin script I don't want to duplicate. But there's not a great way to search the path for it

lib/sailsDbMigrate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
var util = require('util');
4-
var spawn = require('child_process').spawn;
4+
var fork = require('child_process').fork;
55
var path = require('path');
66

77
/**
@@ -104,7 +104,7 @@ module.exports = function (args, sails, done) {
104104
process.env.DATABASE_URL = parsed.url;
105105

106106
// run db-migrate.
107-
child = spawn(dbMigrate, args, { stdio: 'inherit' });
107+
child = fork(dbMigrate, args);
108108
child.on('exit', function (code) {
109109
if (code !== 0) {
110110
return done(new Error('Migrations failed'));

0 commit comments

Comments
 (0)