Charles 5606a4cc0e fix(@angular/cli): handle promise rejection on analytics install prompt (#15455)
A rejection in this case should be ignored to prevent potential installation failure.
2019-08-27 10:24:32 -07:00

20 lines
402 B
JavaScript

'use strict';
// This file is ES6 because it needs to be executed as is.
if ('NG_CLI_ANALYTICS' in process.env) {
return;
}
try {
var analytics = require('../../models/analytics');
analytics
.hasGlobalAnalyticsConfiguration()
.then(hasGlobalConfig => {
if (!hasGlobalConfig) {
return analytics.promptGlobalAnalytics();
}
})
.catch(() => {});
} catch (_) {}