diff --git a/index.js b/index.js index cbd5e64f..e001a103 100644 --- a/index.js +++ b/index.js @@ -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'); diff --git a/lib/cmd/pkgfiles.js b/lib/cmd/pkgfiles.js index 4997fa5b..e9984d75 100644 --- a/lib/cmd/pkgfiles.js +++ b/lib/cmd/pkgfiles.js @@ -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'; } diff --git a/lib/command.js b/lib/command.js index f4b53454..9ee86061 100644 --- a/lib/command.js +++ b/lib/command.js @@ -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 diff --git a/package.json b/package.json index 4836c1b3..f927654b 100644 --- a/package.json +++ b/package.json @@ -58,9 +58,9 @@ "node": ">= 6.0.0" }, "files": [ - "bin", + "index.js", "lib", - "index.js" + "bin" ], "ci": { "version": "6, 7" diff --git a/test/my-egg-bin.test.js b/test/my-egg-bin.test.js index 182e6a4c..fb4bf18a 100644 --- a/test/my-egg-bin.test.js +++ b/test/my-egg-bin.test.js @@ -59,6 +59,7 @@ 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', ]; @@ -66,7 +67,7 @@ describe('test/my-egg-bin.test.js', () => { // .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); });