1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const tslib_1 = require("tslib");
|
4 | const base_1 = tslib_1.__importStar(require("../base"));
|
5 | class Whoami extends base_1.default {
|
6 | async run() {
|
7 | this.parse(Whoami);
|
8 | const config = await this.isLoggedIn();
|
9 | this.log('\n');
|
10 | this.log(`${this.ux.colors.green(this.ux.colors.bold(' Email: '))}${config.user.email}`);
|
11 | this.log(`${this.ux.colors.green(this.ux.colors.bold(' Username: '))}${config.user.username}`);
|
12 | this.log(`${this.ux.colors.green(this.ux.colors.bold(' Team Name: '))}${config.team.name}`);
|
13 | if (config.user.registryHost) {
|
14 | this.debug(`${this.ux.colors.green(this.ux.colors.bold('\n OPS_REGISTRY_HOST: '))}${config.user.registryHost}`);
|
15 | }
|
16 | if (config.user.nodeEnv) {
|
17 | this.debug(`${this.ux.colors.green(this.ux.colors.bold(' NODE_ENV: '))}${config.user.nodeEnv}`);
|
18 | }
|
19 | this.log('\n');
|
20 | this.services.analytics.track({
|
21 | userId: this.user.email,
|
22 | teamId: this.team.id,
|
23 | event: 'Ops CLI Whoami',
|
24 | properties: {},
|
25 | }, this.accessToken);
|
26 | }
|
27 | }
|
28 | Whoami.description = 'Display your user information';
|
29 | Whoami.flags = {
|
30 | help: base_1.flags.help({ char: 'h' }),
|
31 | };
|
32 | exports.default = Whoami;
|