File tree 1 file changed +21
-1
lines changed 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { cacheDir } from '../utils/cache-directory';
19
19
import { createHash } from 'crypto' ;
20
20
import { TasksRunner } from '../tasks-runner/tasks-runner' ;
21
21
import { RemoteCacheV2 } from '../tasks-runner/default-tasks-runner' ;
22
+ import { workspaceRoot } from '../utils/workspace-root' ;
22
23
23
24
interface CloudBundleInstall {
24
25
version : string ;
@@ -150,7 +151,26 @@ export async function verifyOrUpdateNxCloudClient(
150
151
nxCloudClient : require ( currentBundle . fullPath ) ,
151
152
} ;
152
153
}
153
- const runnerBundleInstallDirectory = join ( cacheDir , 'cloud' ) ;
154
+
155
+ function getBundleInstallDefaultLocation ( ) {
156
+ const legacyPath = join (
157
+ workspaceRoot ,
158
+ 'node_modules' ,
159
+ '.cache' ,
160
+ 'nx' ,
161
+ 'cloud'
162
+ ) ;
163
+
164
+ // this legacy path is used when the nx-cloud package is installed.
165
+ // make sure to reuse it so that we don't `require` different the client bundles
166
+ if ( existsSync ( legacyPath ) ) {
167
+ return legacyPath ;
168
+ } else {
169
+ return join ( cacheDir , 'cloud' ) ;
170
+ }
171
+ }
172
+
173
+ const runnerBundleInstallDirectory = getBundleInstallDefaultLocation ( ) ;
154
174
155
175
function getLatestInstalledRunnerBundle ( ) : CloudBundleInstall | null {
156
176
if ( ! existsSync ( runnerBundleInstallDirectory ) ) {
You can’t perform that action at this time.
0 commit comments