Skip to content

Commit

Permalink
feat(nx): add a warning about using --all flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Jun 21, 2019
1 parent 5b4127e commit 815a3b5
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion packages/workspace/src/command-line/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,39 @@ const ig = ignore();
ig.add(readFileIfExisting(`${appRoot.path}/.gitignore`));

export function printArgsWarning(options: YargsAffectedOptions) {
const { files, uncommitted, untracked, base, head } = options;
const { files, uncommitted, untracked, base, head, all } = options;

if (
!files &&
!uncommitted &&
!untracked &&
!base &&
!head &&
!all &&
options._.length < 2
) {
console.log('Note: Nx defaulted to --base=master --head=HEAD');
}

if (all) {
console.warn(
'****************************************************************************************'
);
console.warn('WARNING:');
console.warn(
'Running affected:* commands with --all can result in very slow builds.'
);
console.warn(
'It is not meant to be used for any sizable project or to be used in CI.'
);
console.warn(
'Read about rebuilding and retesting only what is affected here:'
);
console.warn('https://nx.dev/guides/monorepo-affected.');
console.warn(
'****************************************************************************************'
);
}
}

export function parseFiles(options: YargsAffectedOptions): { files: string[] } {
Expand Down

0 comments on commit 815a3b5

Please sign in to comment.