File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
core/lerna/commands/add-caching Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,21 @@ class AddCachingCommand extends Command {
26
26
) ;
27
27
// eslint-disable-next-line no-process-exit
28
28
process . exit ( 1 ) ;
29
+ } // TODO: remove auto-setting useNx: true in v6
30
+ else if ( ! this . options . useNx ) {
31
+ const lernaJsonPath = joinPathFragments ( workspaceRoot , "lerna.json" ) ;
32
+ try {
33
+ const lernaJson = readJsonFile ( lernaJsonPath ) ;
34
+ lernaJson . useNx = true ;
35
+ writeJsonFile ( lernaJsonPath , lernaJson ) ;
36
+ } catch {
37
+ this . logger . error (
38
+ "add-caching" ,
39
+ "The `add-caching` command is only available when using the Nx task runner (set `useNx` to `true` in `lerna.json`)"
40
+ ) ;
41
+ // eslint-disable-next-line no-process-exit
42
+ process . exit ( 1 ) ;
43
+ }
29
44
}
30
45
31
46
const packages = this . packageGraph ?. rawPackageList || [ ] ;
You can’t perform that action at this time.
0 commit comments