@aiot-toolkit/commander 2.0.6-beta.27 → 2.0.6-beta.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/Command.js +2 -6
  2. package/package.json +3 -4
package/lib/Command.js CHANGED
@@ -32,7 +32,6 @@ class Command {
32
32
  _commander.program.parse();
33
33
  }
34
34
  static registeCommand(command) {
35
- var _this = this;
36
35
  const {
37
36
  name,
38
37
  description,
@@ -66,10 +65,7 @@ class Command {
66
65
  });
67
66
 
68
67
  // 设置交互式问题
69
- instance.action(async function () {
70
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
71
- args[_key] = arguments[_key];
72
- }
68
+ instance.action(async (...args) => {
73
69
  let option = args[args.length - 2];
74
70
  if (paramList) {
75
71
  // 检查询问式参数
@@ -83,7 +79,7 @@ class Command {
83
79
  const haveSet = valueSource && valueSource !== 'default';
84
80
  // 如果启用询问,且未已显式设置值,则通过询问收集参数
85
81
  if (enableInquirer && !haveSet) {
86
- const result = await _this.collectParam(item);
82
+ const result = await this.collectParam(item);
87
83
  if (result) {
88
84
  for (let key in result) {
89
85
  option[key] = result[key];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiot-toolkit/commander",
3
- "version": "2.0.6-beta.27",
3
+ "version": "2.0.6-beta.29",
4
4
  "description": "A tool that generates complete commands with configuration",
5
5
  "keywords": [
6
6
  "aiot",
@@ -20,10 +20,9 @@
20
20
  "test": "node ./__tests__/commander.test.js"
21
21
  },
22
22
  "dependencies": {
23
- "@aiot-toolkit/shared-utils": "2.0.6-beta.27",
23
+ "@aiot-toolkit/shared-utils": "2.0.6-beta.29",
24
24
  "@inquirer/prompts": "^3.0.3",
25
25
  "chalk": "^4.0.0",
26
26
  "commander": "^11.0.0"
27
- },
28
- "gitHead": "1348e0b4f0fb3b43bc3adc4a4c5b2b0be29c680b"
27
+ }
29
28
  }