Skip to content

Commit

Permalink
style networkId and prompt near login
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisjoshford committed Apr 15, 2021
1 parent b92c61c commit 290acd1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/check-credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ module.exports = async function checkCredentials(
if(networkId !== 'testnet' && networkId !== 'default') return;
if (!(await keyStore.getKey(networkId, accountId))) {
console.log(
chalk`{bold.white Unable to find [ ${networkId} ] credentials for [ ${accountId} ]}`
chalk`{bold.white Unable to find [ {bold.blue ${networkId}} ] credentials for [ {bold.blue ${accountId}} ]...}`
);
const testnetKeys = await keyStore.getKey('testnet', accountId);
const defaultKeys = await keyStore.getKey('default', accountId);
if (defaultKeys && networkId === 'testnet') {
const answer = await askYesNoQuestion(
chalk`{bold.white Key found in {bold.yellow deprecated} [ default ] folder. Would you like to copy your key to [ testnet ] folder? (y/n)}`,
chalk`{bold.white Key found in {bold.yellow deprecated} [ {bold.blue default} ] folder. Would you like to copy your key to [ {bold.blue testnet} ] folder? {bold.green (y/n)}}`,
false
);
if (answer) {
console.log(chalk`{bold.white Copying key and attempting transaction...}`);
await keyStore.setKey('testnet', accountId, defaultKeys);
} else {
throw console.log(
chalk`{bold.white Please relocate credentials found in [ default ] directory to [ testnet ] directory.}`
chalk`{bold.white Please relocate credentials found in [ {bold.blue default} ] directory to [ {bold.blue testnet} ] directory using {bold.yellow near login}.}`
);
}
} else if (testnetKeys && networkId === 'default') {
Expand Down

0 comments on commit 290acd1

Please sign in to comment.