Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
fix: create-account
Browse files Browse the repository at this point in the history
near create-account was failing because we were catching the wrong message returned by account.state()
  • Loading branch information
gagdiez authored Mar 4, 2024
2 parents e570a2d + 19cea16 commit e0bce38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions commands/account/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ async function assertAccountDoesNotExist(accountId, near) {
await account.state();
throw new Error(`Sorry, account '${accountId}' already exists.`);
} catch (e) {
if (!e.message.includes('does not exist while viewing')) {
throw e;
}
const opt1 = e.message.includes('does not exist');
const opt2 = e.message.includes('doesn\'t exist');
if (!opt1 && !opt2) throw e;
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-cli",
"version": "4.0.8",
"version": "4.0.9",
"description": "Simple CLI for interacting with NEAR Protocol",
"engines": {
"node": ">= 16"
Expand Down

0 comments on commit e0bce38

Please sign in to comment.