Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit 28baf06

Browse files
committed
Allow multiple extra node arguments to be passed
Without this patch, invoking `swagger project start --node-args "--harmony --harmony_destructuring "` would fail because of passing `--harmony --harmony_destructuring ` as one argument to node(mon)
1 parent fac9037 commit 28baf06

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

lib/commands/project/project.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function start(directory, options, cb) {
144144
nodemonOpts.nodeArgs.push(debugArg);
145145
}
146146
if (options.nodeArgs) {
147-
nodemonOpts.nodeArgs.push(options.nodeArgs)
147+
nodemonOpts.nodeArgs = nodemonOpts.nodeArgs.concat(options.nodeArgs.split(' '));
148148
}
149149
// https://www.npmjs.com/package/cors
150150
nodemonOpts.env = {

test/commands/project/project.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ describe('project', function() {
200200
});
201201
});
202202

203+
it('should pass multiple extra arguments separately', function(done) {
204+
var options = { nodeArgs: '--harmony --harmony_destructuring' };
205+
project.start(projPath, options, function(err) {
206+
should.not.exist(err);
207+
nodemonOpts.nodeArgs.should.containDeep(['--harmony', '--harmony_destructuring']);
208+
done();
209+
});
210+
});
211+
212+
203213
it('should combine extra arguments with debug', function(done) {
204214
var options = { debug: true, nodeArgs: '--harmony' };
205215
project.start(projPath, options, function(err) {

0 commit comments

Comments
 (0)