1
1
import * as yargs from 'yargs' ;
2
2
import { runCommand } from '../tasks-runner/run-command' ;
3
- import { splitArgsIntoNxArgsAndOverrides , NxArgs } from './utils' ;
4
- import { output } from '../utils/output' ;
3
+ import { NxArgs , splitArgsIntoNxArgsAndOverrides } from './utils' ;
5
4
import {
6
5
createProjectGraph ,
7
6
ProjectGraph ,
8
7
ProjectGraphNode ,
9
8
withDeps
10
9
} from '../core/project-graph' ;
11
10
import { readEnvironment } from '../core/file-utils' ;
12
- import { projectHasTargetAndConfiguration } from '../utils/project-has-target-and-configuration' ;
13
11
import { DefaultReporter } from '../tasks-runner/default-reporter' ;
12
+ import { projectHasTarget } from '../utils/project-graph-utils' ;
13
+ import { output } from '@nrwl/workspace' ;
14
14
15
15
export function runMany ( parsedArgs : yargs . Arguments ) : void {
16
16
const { nxArgs, overrides } = splitArgsIntoNxArgsAndOverrides (
@@ -37,11 +37,7 @@ export function runMany(parsedArgs: yargs.Arguments): void {
37
37
function projectsToRun ( nxArgs : NxArgs , projectGraph : ProjectGraph ) {
38
38
const allProjects = Object . values ( projectGraph . nodes ) ;
39
39
if ( nxArgs . all ) {
40
- return runnableForTargetAndConfiguration (
41
- allProjects ,
42
- nxArgs . target ,
43
- nxArgs . configuration
44
- ) ;
40
+ return runnableForTarget ( allProjects , nxArgs . target ) ;
45
41
} else {
46
42
checkForInvalidProjects ( nxArgs , allProjects ) ;
47
43
let selectedProjects = allProjects . filter (
@@ -52,12 +48,7 @@ function projectsToRun(nxArgs: NxArgs, projectGraph: ProjectGraph) {
52
48
withDeps ( projectGraph , selectedProjects ) . nodes
53
49
) ;
54
50
}
55
- return runnableForTargetAndConfiguration (
56
- selectedProjects ,
57
- nxArgs . target ,
58
- nxArgs . configuration ,
59
- true
60
- ) ;
51
+ return runnableForTarget ( selectedProjects , nxArgs . target , true ) ;
61
52
}
62
53
}
63
54
@@ -73,17 +64,16 @@ function checkForInvalidProjects(
73
64
}
74
65
}
75
66
76
- function runnableForTargetAndConfiguration (
67
+ function runnableForTarget (
77
68
projects : ProjectGraphNode [ ] ,
78
69
target : string ,
79
- configuration ?: string ,
80
70
strict = false
81
71
) : ProjectGraphNode [ ] {
82
72
const notRunnable = [ ] ;
83
73
const runnable = [ ] ;
84
74
85
75
for ( let project of projects ) {
86
- if ( projectHasTargetAndConfiguration ( project , target , configuration ) ) {
76
+ if ( projectHasTarget ( project , target ) ) {
87
77
runnable . push ( project ) ;
88
78
} else {
89
79
notRunnable . push ( project ) ;
0 commit comments