Skip to content

Commit

Permalink
feat(core): add nx-console installation source to nx connect (#27307)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8464d80)
  • Loading branch information
MaxKless authored and FrozenPandaz committed Aug 7, 2024
1 parent 7acd5a8 commit 7bbe166
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/nx/src/command-line/connect/connect-to-nx-cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export async function connectToNxCloudCommand(
): Promise<boolean> {
const nxJson = readNxJson();

const installationSource = process.env.NX_CONSOLE
? 'nx-console'
: 'nx-connect';

if (isNxCloudUsed(nxJson)) {
const token =
process.env.NX_CLOUD_ACCESS_TOKEN || nxJson.nxCloudAccessToken;
Expand All @@ -80,7 +84,7 @@ export async function connectToNxCloudCommand(
);
}
const connectCloudUrl = await createNxCloudOnboardingURL(
'nx-connect',
installationSource,
token
);
output.log({
Expand All @@ -96,7 +100,7 @@ export async function connectToNxCloudCommand(
return false;
}
const token = await connectWorkspaceToCloud({
installationSource: command ?? 'nx-connect',
installationSource: command ?? installationSource,
});

const connectCloudUrl = await createNxCloudOnboardingURL('nx-connect', token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ export async function connectToNxCloud(

// do NOT create Nx Cloud token (createNxCloudWorkspace)
// if user is using github and is running nx-connect
if (!(usesGithub && schema.installationSource === 'nx-connect')) {
if (
!(
usesGithub &&
(schema.installationSource === 'nx-connect' ||
schema.installationSource === 'nx-console')
)
) {
responseFromCreateNxCloudWorkspace = await createNxCloudWorkspace(
getRootPackageName(tree),
schema.installationSource,
Expand Down

0 comments on commit 7bbe166

Please sign in to comment.