Skip to content

Commit

Permalink
update the flow
Browse files Browse the repository at this point in the history
  • Loading branch information
vadiminc committed Jan 30, 2024
1 parent 2c65d0c commit 6781a83
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dist/esbuild/main.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/tsc/src/commands/actions/KeySharesAction.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tsc/src/commands/actions/KeySharesAction.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions dist/tsc/src/commands/actions/validators/file.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tsc/src/commands/actions/validators/file.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/commands/actions/KeySharesAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ export class KeySharesAction extends BaseAction {
}

private async saveKeyShares(keySharesItems: KeySharesItem[], outputFolder: string): Promise<string> {
if (keySharesItems.length === 0) {
throw new SSVKeysException('Unable to locate valid keystore files. Please verify that the keystore files are valid and the password is correct.')
}

const keyShares = new KeyShares();
keySharesItems.forEach(keySharesItem => keyShares.add(keySharesItem));

Expand Down
3 changes: 1 addition & 2 deletions src/commands/actions/validators/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import fs from 'fs';

export const fileExistsValidator = (filePath: string, message = ''): boolean | string => {
filePath = sanitizePath(String(filePath).trim());
console.log('new as old:::', filePath);
const exists = fs.existsSync(filePath);
return exists || message || 'Couldn’t locate the keystore file.';
return exists || message || 'Couldn’t locate the keystores file path. Please provide a valid path.';
};

export const jsonFileValidator = (filePath: string, message = ''): boolean | string => {
Expand Down

0 comments on commit 6781a83

Please sign in to comment.