Skip to content

Conversation

atian25
Copy link
Member

@atian25 atian25 commented Nov 25, 2017

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

lib/cmd/stop.js Outdated
argv.baseDir = baseDir;

const pkgInfo = require(path.join(baseDir, 'package.json'));
argv.title = argv.title || `egg-server-${pkgInfo.name}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要默认吧,stop 应该全杀,不然改了 package name 就杀不掉进程了。

可以改成 title 不存在就不传。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以加个这个用例

@atian25
Copy link
Member Author

atian25 commented Nov 28, 2017

改了,干掉 baseDir 的支持。

lib/cmd/stop.js Outdated
let processList = yield this.helper.findNodeProcess(item => {
const cmd = item.cmd;
return cmd.includes('start-cluster');
return cmd.includes('start-cluster') && (!argv.title || cmd.includes(`"title":"${argv.title}"`));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个逻辑看着有点绕,还是先判断 title 吧

argv.title ?
  cmd.includes('start-cluster') && cmd.includes(`"title":"${argv.title}"`) :
  cmd.includes('start-cluster')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改了,下面的也一起改了

@popomore popomore merged commit 4c41319 into master Nov 28, 2017
@popomore popomore deleted the stop-title branch November 28, 2017 10:54
@popomore
Copy link
Member

  • egg-scripts@2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

egg-scripts stop 支持 title 或者路径参数 请问egg-scripts1.x升级到2.x主要变化是什么?

2 participants