Skip to content

Commit

Permalink
feat: extractArgv support expose_debug_as
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 committed Mar 24, 2017
1 parent 18b4a45 commit 6f5d525
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ exports.CovCommand = require('./lib/cmd/cov');
exports.DevCommand = require('./lib/cmd/dev');
exports.TestCommand = require('./lib/cmd/test');
exports.DebugCommand = require('./lib/cmd/debug');
exports.PkgfilesCommand = require('./lib/cmd/pkgfiles');
5 changes: 5 additions & 0 deletions lib/cmd/pkgfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
const Command = require('../command');

class PkgfilesCommand extends Command {
constructor(rawArgv) {
super(rawArgv);
this.usage = 'Usage: egg-bin pkgfiles';
}

get description() {
return 'Generate pkg.files automatically';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Command extends BaseCommand {

// extract execArgv to special item
context.execArgv = this.helper.unparseArgv(argv, {
includes: [ 'debug', 'debug-brk', 'inspect', 'inspect-brk', 'es_staging', /^harmony.*/ ],
includes: [ 'debug', 'debug-brk', 'inspect', 'inspect-brk', 'es_staging', 'expose_debug_as', /^harmony.*/ ],
});

// remove unuse args
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
"node": ">= 6.0.0"
},
"files": [
"bin",
"index.js",
"lib",
"index.js"
"bin"
],
"ci": {
"version": "6, 7"
Expand Down
3 changes: 2 additions & 1 deletion test/my-egg-bin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ describe('test/my-egg-bin.test.js', () => {
'echo',
'--baseDir=./dist',
'--debug=5555', '--debug-brk',
'--expose_debug_as=v8debug',
'--inspect', '6666', '--inspect-brk',
'--es_staging', '--harmony', '--harmony_default_parameters',
];
coffee.fork(eggBin, args, { cwd })
// .debug()
.expect('stdout', /"baseDir":".\/dist"/)
.notExpect('stdout', /"debugBrk":true/)
.expect('stdout', /"execArgv":\["--debug=5555","--debug-brk","--inspect=6666","--inspect-brk","--es_staging","--harmony","--harmony_default_parameters"]/)
.expect('stdout', /"execArgv":\["--debug=5555","--debug-brk","--expose_debug_as=v8debug","--inspect=6666","--inspect-brk","--es_staging","--harmony","--harmony_default_parameters"]/)
.expect('code', 0)
.end(done);
});
Expand Down

0 comments on commit 6f5d525

Please sign in to comment.