autod.js 628 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. const Command = require('../command');
  3. class AutodCommand extends Command {
  4. constructor(rawArgv) {
  5. super(rawArgv);
  6. this.usage = 'Usage: egg-bin autod';
  7. this.options = {
  8. check: {
  9. description: 'dependencies checker',
  10. },
  11. };
  12. }
  13. get description() {
  14. return 'Generate pkg.dependencies and pkg.devDependencies automatically';
  15. }
  16. * run({ cwd, argv }) {
  17. const args = [];
  18. if (argv.check) args.push('--check');
  19. const autodBin = require.resolve('autod/bin/autod.js');
  20. yield this.helper.forkNode(autodBin, args, { cwd });
  21. }
  22. }
  23. module.exports = AutodCommand;