Skip to content

Commit 02a3d7b

Browse files
alan-agius4dgp1130
authored andcommitted
fix(@angular/cli): skip node.js compatibility checks when running completion
A warning at this stage could cause a broken source action (`source <(ng completion script)`) when in the shell init script. Closes #24104 (cherry picked from commit 1e4dbfd)
1 parent 5d54503 commit 02a3d7b

File tree

1 file changed

+10
-0
lines changed
  • packages/angular/cli/bin

1 file changed

+10
-0
lines changed

packages/angular/cli/bin/ng.js

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ try {
2020
process.title = 'ng';
2121
}
2222

23+
const rawCommandName = process.argv[2];
24+
25+
if (rawCommandName === '--get-yargs-completions' || rawCommandName === 'completion') {
26+
// Skip Node.js supported checks when running ng completion.
27+
// A warning at this stage could cause a broken source action (`source <(ng completion script)`) when in the shell init script.
28+
require('./bootstrap');
29+
30+
return;
31+
}
32+
2333
// This node version check ensures that extremely old versions of node are not used.
2434
// These may not support ES2015 features such as const/let/async/await/etc.
2535
// These would then crash with a hard to diagnose error message.

0 commit comments

Comments
 (0)