Skip to content

Commit

Permalink
fix(nx-cloud): fix nx connect throwing if run twice
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKless committed Oct 19, 2023
1 parent b9e671c commit 6e7e74a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/nx/src/utils/nx-cloud-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function isNxCloudUsed(nxJson: NxJsonConfiguration) {
)
);
}
Ç;

export function getNxCloudUrl(nxJson: NxJsonConfiguration): string {
const cloudRunner = Object.values(nxJson.tasksRunnerOptions ?? {}).find(
Expand All @@ -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;
}

0 comments on commit 6e7e74a

Please sign in to comment.