Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof options.debug === 'string') {
debugArg += '=' + options.debug;
}
nodemonOpts.nodeArgs.push(debugArg);
}
if (options.nodeArgs) {
nodemonOpts.nodeArgs = nodemonOpts.nodeArgs.concat(options.nodeArgs.split(' '));
}
var nodemon = require('nodemon');
// hack to enable proxyquire stub for testing...
if (_.isFunction(nodemon)) {
nodemon(nodemonOpts);
} else {
nodemon._init(nodemonOpts, cb);
}
nodemon.on('start', function () {
console.log(' project will restart on model changes.');
if (options.open) {
setTimeout(function() {
open(directory, options, cb);
}, 500);
}
}).on('restart', function (files) {
console.log('Project restarted. Files changed: ' + files);
}).on('quit', function () {
process.exit(0);
}).on('readable', function() { // the `readable` event indicates that data is ready to pick up
this.stdout.pipe(process.stdout);
this.stderr.pipe(process.stderr);
nodemonOpts.nodeArgs = '--debug-brk';
if (typeof(options.debugBrk == 'String')) {
nodemonOpts.nodeArgs += '=' + options.debugBrk;
}
}
if (options.debug) {
nodemonOpts.nodeArgs = '--debug';
if (typeof(options.debug == 'String')) {
nodemonOpts.nodeArgs += '=' + options.debug;
}
}
// hack to enable proxyquire stub for testing...
if (_.isFunction(nodemon)) {
nodemon(nodemonOpts);
} else {
nodemon._init(nodemonOpts, cb);
}
nodemon.on('start', function () {
emit(' project started here: ' + project.api.localUrl);
emit(' project will restart on changes.');
emit(' to restart at any time, enter `rs`');
if (options.open) {
setTimeout(function() {
open(directory, options, cb);
}, 500);
}
}).on('quit', function () {
emit('Project quit.');
account.removeDeploymentFiles(project);
}).on('restart', function (files) {
emit('Project restarted. Files changed: ', files);
if (options.nodeArgs) {
nodemonOpts.nodeArgs = nodemonOpts.nodeArgs.concat(options.nodeArgs.split(' '));
}
// https://www.npmjs.com/package/cors
nodemonOpts.env = {
swagger_corsOptions: '{}' // enable CORS so editor "try it" function can work
};
if (options.mock) {
nodemonOpts.env.swagger_mockMode = true
}
var nodemon = require('nodemon');
// hack to enable proxyquire stub for testing...
if (_.isFunction(nodemon)) {
nodemon(nodemonOpts);
} else {
nodemon._init(nodemonOpts, cb);
}
nodemon.on('start', function () {
emit(' project started here: ' + project.api.localUrl);
emit(' project will restart on changes.');
emit(' to restart at any time, enter `rs`');
if (options.open) {
setTimeout(function() {
open(directory, options, cb);
}, 500);
}
}).on('restart', function (files) {
emit('Project restarted. Files changed: ', files);
}).on('quit', function () {
process.exit(0);
});