Skip to content

Commit ba1a96b

Browse files
committed
update
1 parent e2222ac commit ba1a96b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/commands/organizations/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable no-console */
22

3+
import chalk from 'chalk'
34
import meow from 'meow'
45
import ora from 'ora'
56

@@ -46,7 +47,8 @@ function setupCommand (name, description, argv, importMeta) {
4647
* @returns {Promise<void|OrganizationsData>}
4748
*/
4849
async function fetchOrganizations () {
49-
const socketSdk = await setupSdk(getDefaultKey())
50+
const apiKey = getDefaultKey()
51+
const socketSdk = await setupSdk(apiKey)
5052
const spinner = ora('Fetching organizations...').start()
5153

5254
const result = await handleApiCall(socketSdk.getOrganizations(), 'looking up organizations')
@@ -58,7 +60,12 @@ async function fetchOrganizations () {
5860
spinner.stop()
5961

6062
const organizations = Object.values(result.data.organizations)
61-
console.log('List of organizations:')
63+
if (apiKey) {
64+
console.log(`List of organizations associated with your API key: ${chalk.italic(apiKey)}`)
65+
} else {
66+
console.log('List of organizations associated with your API key.')
67+
}
68+
6269
organizations.map(o => {
6370
console.log(`
6471
Name: ${o?.name}

0 commit comments

Comments
 (0)