Skip to content

fix(@angular/cli): ng completion inside of ng app folders warns but does not produce output #7366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions packages/@angular/cli/bin/ng
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,21 @@ resolve('@angular/cli', { basedir: process.cwd() },
}

if (shouldWarn && CliConfig.fromGlobal().get('warnings.versionMismatch')) {
// eslint-disable no-console
console.log(yellow(stripIndents`
Your global Angular CLI version (${globalVersion}) is greater than your local
version (${localVersion}). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
`));
let warning = yellow(stripIndents`
Your global Angular CLI version (${globalVersion}) is greater than your local
version (${localVersion}). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
`);
// Don't show warning colorised on `ng completion`
if (process.argv[2] !== 'completion') {
// eslint-disable no-console
console.log(warning);
} else {
// eslint-disable no-console
console.error(warning);
process.exit(1);
}
}

// No error implies a projectLocalCli, which will load whatever
Expand Down