Skip to content

Commit

Permalink
fix: use co wrap generator for egg-bin run method
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Dec 11, 2019
1 parent fa108ef commit 14cdb2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/midway-bin/lib/cmd/debug.js
@@ -1,5 +1,6 @@
'use strict';
const resolver = require('../util').resolveModule;
const co = require('co');

class DebugCommand extends require('egg-bin').DebugCommand {
constructor(rawArgv) {
Expand All @@ -11,7 +12,7 @@ class DebugCommand extends require('egg-bin').DebugCommand {
if (!context.argv.framework) {
context.argv.framework = this.findFramework('midway') || this.findFramework('midway-mirror');
}
await super.run(context);
await co(super.run(context));
}

findFramework(module) {
Expand Down
3 changes: 2 additions & 1 deletion packages/midway-bin/lib/cmd/dev.js
@@ -1,5 +1,6 @@
'use strict';
const resolver = require('../util').resolveModule;
const co = require('co');

class DevCommand extends require('egg-bin/lib/cmd/dev') {
constructor(rawArgv) {
Expand All @@ -12,7 +13,7 @@ class DevCommand extends require('egg-bin/lib/cmd/dev') {
if (!context.argv.framework) {
context.argv.framework = this.findFramework('midway') || this.findFramework('midway-mirror');
}
await super.run(context);
await co(super.run(context));
}

findFramework(module) {
Expand Down

0 comments on commit 14cdb2d

Please sign in to comment.