Skip to content

Commit 4ccaa04

Browse files
committed
feat(@angular/cli): add flags to the process title
Closes #8772 Fixes #6888 Special thanks to @tomastrajan for original PR.
1 parent ec3fa80 commit 4ccaa04

File tree

2 files changed

+18
-2
lines changed
  • packages/angular/cli/bin
  • tests/legacy-cli/e2e/tests/misc

2 files changed

+18
-2
lines changed

packages/angular/cli/bin/ng

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
// Provide a title to the process in `ps`.
55
// Due to an obscure Mac bug, do not start this title with any symbol.
6-
process.title = 'ng';
6+
process.title = 'ng ' + Array.from(process.argv).slice(2).join(' ');
77

8-
var version = process.version.substr(1).split('.');
8+
const version = process.version.substr(1).split('.');
99
if (Number(version[0]) < 8 || (Number(version[0]) === 8 && Number(version[1]) < 9)) {
1010
process.stderr.write(
1111
'You are running version ' + process.version + ' of Node.js, which is not supported by Angular CLI v6.\n' +
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {exec, execAndWaitForOutputToMatch, killAllProcesses} from '../../utils/process';
2+
3+
4+
export default async function() {
5+
try {
6+
await execAndWaitForOutputToMatch('ng', ['build', '--watch'], /./);
7+
8+
const output = await exec('ps');
9+
10+
if (!output.stdout.match(/ng build --watch/)) {
11+
throw new Error('Title of the process was not properly set.');
12+
}
13+
} finally {
14+
await killAllProcesses();
15+
}
16+
}

0 commit comments

Comments
 (0)