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

Commit

Permalink
add yarg’s strict() to chain. add walletUrl, contractName as options (#…
Browse files Browse the repository at this point in the history
…265)

* add yarg’s strict() to chain. add walletUrl, contractName as options

* add hidden key to walletUrl and contractName

* add masterAccount option in near-cli

* fix test using delete_account to delete

* fix test using defult to ci networkId

* fix lint spacing

* remove node 10 from travis

* fix typo for masterAccount description

* in test_generate_key, use $NODE_ENV as flag and directory
  • Loading branch information
mikedotexe authored Mar 31, 2020
1 parent 1fbb902 commit 2932fb2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: node_js
node_js:
- 10
- 12
env:
- NODE_ENV=ci
Expand Down
18 changes: 18 additions & 0 deletions bin/near-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ const clean = {

let config = require('../get-config')();
yargs // eslint-disable-line
.strict()
.middleware(require('../utils/check-version'))
.scriptName('near')
.option('nodeUrl', {
Expand All @@ -170,6 +171,22 @@ yargs // eslint-disable-line
desc: 'Unique identifier for the account',
type: 'string',
})

.option('walletUrl', {
desc: 'Website for NEAR Wallet',
type: 'string',
hidden: true
})
.option('contractName', {
desc: 'Account name of contract',
type: 'string',
hidden: true
})
.option('masterAccount', {
desc: 'Master account used when creating new accounts',
type: 'string',
hidden: true
})
.middleware(require('../middleware/print-options'))
.middleware(require('../middleware/key-store'))
.command(require('../commands/create-account'))
Expand Down Expand Up @@ -198,6 +215,7 @@ yargs // eslint-disable-line
'outDir': 'out_dir'
})
.showHelpOnFail(true)
.recommendCommands()
.demandCommand(1, chalk`Pass {bold --help} to see all available commands and options.`)
.usage(chalk`Usage: {bold $0 <command> [options]}`)
.epilogue(chalk`Check out our epic whiteboard series: {bold http://near.ai/wbs}`)
Expand Down
2 changes: 1 addition & 1 deletion test/test_account_operations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ if [[ ! "$RESULT" =~ $EXPECTED ]]; then
exit 1
fi

../bin/near delete_account $testaccount test.near
../bin/near delete $testaccount test.near
6 changes: 3 additions & 3 deletions test/test_generate_key.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

#!/bin/bash
set -ex
KEY_FILE=neardev/default/generate-key-test.json
KEY_FILE=neardev/$NODE_ENV/generate-key-test.json
rm -f "$KEY_FILE"

RESULT=$(./bin/near generate-key generate-key-test --networkId default)
RESULT=$(./bin/near generate-key generate-key-test --networkId $NODE_ENV)
echo $RESULT

if [[ ! -f "${KEY_FILE}" ]]; then
Expand All @@ -18,7 +18,7 @@ if [[ ! "$RESULT" =~ $EXPECTED ]]; then
exit 1
fi

RESULT2=$(./bin/near generate-key generate-key-test --networkId default)
RESULT2=$(./bin/near generate-key generate-key-test --networkId $NODE_ENV)
echo $RESULT2

EXPECTED2=".*Account has existing key pair with ed25519:.+ public key.*"
Expand Down

0 comments on commit 2932fb2

Please sign in to comment.