Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 34e6c14

Browse files
committedAug 18, 2020
fix(core): do not print warnings for print-affected
1 parent b0ada64 commit 34e6c14

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
 

Diff for: ‎packages/workspace/src/command-line/affected.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import { DefaultReporter } from '../tasks-runner/default-reporter';
2020
export function affected(command: string, parsedArgs: yargs.Arguments): void {
2121
const { nxArgs, overrides } = splitArgsIntoNxArgsAndOverrides(
2222
parsedArgs,
23-
'affected'
23+
'affected',
24+
{
25+
printWarnings: command !== 'print-affected' && !parsedArgs.plain,
26+
}
2427
);
2528

2629
const projectGraph = createProjectGraph();

Diff for: ‎packages/workspace/src/command-line/utils.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ const ignoreArgs = ['$0', '_'];
7272

7373
export function splitArgsIntoNxArgsAndOverrides(
7474
args: yargs.Arguments,
75-
mode: 'run-one' | 'run-many' | 'affected'
75+
mode: 'run-one' | 'run-many' | 'affected' | 'print-affected',
76+
options = { printWarnings: true }
7677
): { nxArgs: NxArgs; overrides: yargs.Arguments } {
7778
const nxSpecific =
7879
mode === 'run-one' ? runOne : mode === 'run-many' ? runMany : runAffected;
@@ -103,7 +104,9 @@ export function splitArgsIntoNxArgsAndOverrides(
103104
}
104105

105106
if (mode === 'affected') {
106-
printArgsWarning(nxArgs);
107+
if (options.printWarnings) {
108+
printArgsWarning(nxArgs);
109+
}
107110
if (
108111
!nxArgs.files &&
109112
!nxArgs.uncommitted &&

0 commit comments

Comments
 (0)
Please sign in to comment.