@@ -25,11 +25,18 @@ export async function updatePackageScripts(
25
25
const nxJson = readNxJson ( tree ) ;
26
26
27
27
const [ pattern , createNodes ] = createNodesTuple ;
28
- const files = glob ( tree , [ pattern ] ) ;
28
+ const matchingFiles = glob ( tree , [ pattern ] ) ;
29
29
30
- for ( const file of files ) {
30
+ for ( const file of matchingFiles ) {
31
31
const projectRoot = getProjectRootFromConfigFile ( file ) ;
32
- await processProject ( tree , projectRoot , file , createNodes , nxJson ) ;
32
+ await processProject (
33
+ tree ,
34
+ projectRoot ,
35
+ file ,
36
+ createNodes ,
37
+ nxJson ,
38
+ matchingFiles
39
+ ) ;
33
40
}
34
41
}
35
42
@@ -38,7 +45,8 @@ async function processProject(
38
45
projectRoot : string ,
39
46
projectConfigurationFile : string ,
40
47
createNodesFunction : CreateNodesFunction ,
41
- nxJsonConfiguration : NxJsonConfiguration
48
+ nxJsonConfiguration : NxJsonConfiguration ,
49
+ configFiles : string [ ]
42
50
) {
43
51
const packageJsonPath = `${ projectRoot } /package.json` ;
44
52
if ( ! tree . exists ( packageJsonPath ) ) {
@@ -52,7 +60,11 @@ async function processProject(
52
60
const result = await createNodesFunction (
53
61
projectConfigurationFile ,
54
62
{ } ,
55
- { nxJsonConfiguration, workspaceRoot }
63
+ {
64
+ nxJsonConfiguration,
65
+ workspaceRoot,
66
+ configFiles,
67
+ }
56
68
) ;
57
69
58
70
const targetCommands = getInferredTargetCommands ( result ) ;
0 commit comments