Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cli/env.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const loadEnv = (): JunoCliEnv => {
const ci = process.env.CI === 'true';

return {
profile,
mode: mode ?? 'production',
containerUrl: envContainerUrl,
console: loadEnvConsole({args, mode}),
Expand Down
11 changes: 5 additions & 6 deletions src/commands/whoami.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {Ed25519KeyIdentity} from '@dfinity/identity';
import {isNullish} from '@dfinity/utils';
import {isNullish, nonNullish} from '@dfinity/utils';
import {green} from 'kleur';
import {getToken, getUse, isDefaultProfile} from '../configs/cli.config';
import {getToken} from '../configs/cli.config';
import {ENV} from '../env';
import {links} from '../services/links.services';

export const whoami = async () => {
Expand All @@ -15,10 +16,8 @@ export const whoami = async () => {
};

const info = async (): Promise<{success: boolean}> => {
const profile = await getUse();

if (!isDefaultProfile(profile)) {
console.log(`👤 Profile: ${green(profile!)}`);
if (nonNullish(ENV.profile)) {
console.log(`👤 Profile: ${ENV.profile}`);
}

const token = await getToken();
Expand Down
1 change: 1 addition & 0 deletions src/types/cli.env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {JunoConfigEnv} from '@junobuild/config';

export type JunoCliEnv = JunoConfigEnv & {
profile: string | undefined;
containerUrl: string | undefined;
console: JunoConsole;
config: JunoCliConfig;
Expand Down