Skip to content

Commit adfd484

Browse files
authored
Merge pull request #98 from AElfProject/fix/load
feat: fix load fatal: no private-key
2 parents 38198e4 + c31507a commit adfd484

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
uses: actions/checkout@v3
1515

1616
- name: Set up Node.js
17-
uses: actions/setup-node@v3
17+
uses: actions/setup-node@v4
1818
with:
19-
node-version: '18'
19+
node-version: '20'
2020

2121
- name: Install dependencies
2222
run: yarn install

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aelf-command",
3-
"version": "0.1.52",
3+
"version": "0.1.53",
44
"description": "A CLI tools for AElf",
55
"main": "src/index.js",
66
"type": "module",
@@ -115,4 +115,4 @@
115115
"path": "./node_modules/cz-conventional-changelog"
116116
}
117117
}
118-
}
118+
}

src/command/baseSubCommand.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ class BaseSubCommand {
197197
...rc,
198198
...uniOptions
199199
});
200-
201200
const globalPrompts = globalOptionsPrompts.filter(
202201
prompt => this.validatorDesc[prompt.name]?.required && !options[prompt.name]
203202
);
@@ -223,11 +222,15 @@ class BaseSubCommand {
223222
}
224223
const subOptionsLength = Object.keys(subCommandOptions).length;
225224
if (subOptionsLength < this.parameters.length) {
226-
const response = BaseSubCommand.normalizeConfig(await inquirer.prompt(this.parameters.slice(subOptionsLength)));
227-
subCommandOptions = {
228-
...subCommandOptions,
229-
...response
230-
};
225+
try {
226+
const response = BaseSubCommand.normalizeConfig(await inquirer.prompt(this.parameters.slice(subOptionsLength)));
227+
subCommandOptions = {
228+
...subCommandOptions,
229+
...response
230+
};
231+
} catch (e) {
232+
console.error(e);
233+
}
231234
}
232235
return {
233236
localOptions,

src/utils/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ const loadCommandParameters = [
261261
inactive: 'no',
262262
suffix: '?',
263263
when(answers) {
264-
return answers['private-key'].trim().split(' ').length > 1;
264+
return answers['private-key']?.trim().split(' ').length > 1;
265265
}
266266
},
267267
{

0 commit comments

Comments
 (0)