Skip to content

Commit 5606a4c

Browse files
clydinmgechev
authored andcommitted
fix(@angular/cli): handle promise rejection on analytics install prompt (#15455)
A rejection in this case should be ignored to prevent potential installation failure.
1 parent 4986577 commit 5606a4c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ if ('NG_CLI_ANALYTICS' in process.env) {
88
try {
99
var analytics = require('../../models/analytics');
1010

11-
analytics.hasGlobalAnalyticsConfiguration().then(hasGlobalConfig => {
12-
if (!hasGlobalConfig) {
13-
return analytics.promptGlobalAnalytics();
14-
}
15-
});
11+
analytics
12+
.hasGlobalAnalyticsConfiguration()
13+
.then(hasGlobalConfig => {
14+
if (!hasGlobalConfig) {
15+
return analytics.promptGlobalAnalytics();
16+
}
17+
})
18+
.catch(() => {});
1619
} catch (_) {}

0 commit comments

Comments
 (0)