From 6e7e74abeca3ace1fdcf457f475e23f35e4dd3b1 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Thu, 19 Oct 2023 11:33:07 +0200 Subject: [PATCH] fix(nx-cloud): fix nx connect throwing if run twice --- packages/nx/src/utils/nx-cloud-utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nx/src/utils/nx-cloud-utils.ts b/packages/nx/src/utils/nx-cloud-utils.ts index 32d61edefee2cf..f704a412fe7b1d 100644 --- a/packages/nx/src/utils/nx-cloud-utils.ts +++ b/packages/nx/src/utils/nx-cloud-utils.ts @@ -8,6 +8,7 @@ export function isNxCloudUsed(nxJson: NxJsonConfiguration) { ) ); } +Ç; export function getNxCloudUrl(nxJson: NxJsonConfiguration): string { const cloudRunner = Object.values(nxJson.tasksRunnerOptions ?? {}).find( @@ -24,7 +25,7 @@ export function getNxCloudToken(nxJson: NxJsonConfiguration): string { ); if (!cloudRunner && !nxJson.nxCloudAccessToken) - throw new Error('nx-cloud runner not find in nx.json'); + throw new Error('nx-cloud runner not found in nx.json'); - return cloudRunner.options.accessToken ?? nxJson.nxCloudAccessToken; + return cloudRunner?.options.accessToken ?? nxJson.nxCloudAccessToken; }