diff --git a/packages/nx/src/command-line/connect.ts b/packages/nx/src/command-line/connect.ts index e07f87099a6969..bfad6be25d61b2 100644 --- a/packages/nx/src/command-line/connect.ts +++ b/packages/nx/src/command-line/connect.ts @@ -35,10 +35,11 @@ export async function connectToNxCloudIfExplicitlyAsked(opts: { } } -export async function connectToNxCloudCommand( - promptOverride?: string -): Promise { - if (isNxCloudUsed()) { +export async function connectToNxCloudCommand({ + promptOverride, + quiet, +}: { promptOverride?: string; quiet?: boolean } = {}): Promise { + if (isNxCloudUsed() && !quiet) { output.log({ title: '✅ This workspace is already connected to Nx Cloud.', bodyLines: [ diff --git a/packages/nx/src/command-line/migrate.ts b/packages/nx/src/command-line/migrate.ts index 5611f0f7a8b8f9..088aac3be46966 100644 --- a/packages/nx/src/command-line/migrate.ts +++ b/packages/nx/src/command-line/migrate.ts @@ -1194,9 +1194,10 @@ async function generateMigrationsJsonAndUpdatePackageJson( (await isMigratingToNewMajor(from, opts.targetVersion)) && !isCI() ) { - const useCloud = await connectToNxCloudCommand( - messages.getPromptMessage('nxCloudMigration') - ); + const useCloud = await connectToNxCloudCommand({ + promptOverride: messages.getPromptMessage('nxCloudMigration'), + quiet: true, + }); await recordStat({ command: 'migrate', nxVersion,