Skip to content

Commit e6feb0d

Browse files
clydinmgechev
authored andcommitted
fix(@angular/cli): ensure analytics prompt exceptions are caught
Fixes #14684
1 parent be21077 commit e6feb0d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

packages/angular/cli/bin/postinstall/analytics-prompt.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ if ('NG_CLI_ANALYTICS' in process.env) {
55
return;
66
}
77

8-
try {
9-
const analytics = require('../../models/analytics');
8+
(async () => {
9+
try {
10+
const analytics = require('../../models/analytics');
1011

11-
if (!analytics.hasGlobalAnalyticsConfiguration()) {
12-
analytics.promptGlobalAnalytics();
13-
}
14-
} catch (_) {}
12+
if (!analytics.hasGlobalAnalyticsConfiguration()) {
13+
await analytics.promptGlobalAnalytics();
14+
}
15+
} catch (_) {}
16+
})();

0 commit comments

Comments
 (0)