Skip to content

Commit 45c19a8

Browse files
hongkongkiwiclaude
andcommitted
refactor: trim profile input and use logical OR for consistency
Address CodeRabbit review feedback: - Use logical OR (||) instead of nullish coalescing (??) to handle empty strings - Trim profile input to handle accidental whitespace from CLI This ensures more robust profile resolution when users provide input with accidental leading/trailing spaces. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 0ca1598 commit 45c19a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/cli-v3/src/commands/whoami.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export async function whoAmI(
7474
embedded: boolean = false,
7575
silent: boolean = false
7676
): Promise<WhoAmIResult> {
77-
const profileToUse = options?.profile ?? readAuthConfigCurrentProfileName();
77+
const profileToUse = options?.profile?.trim() || readAuthConfigCurrentProfileName();
7878

7979
if (!embedded) {
8080
intro(`Displaying your account details [${profileToUse}]`);

0 commit comments

Comments
 (0)