Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular/cli): ensure analytics postinstall script is ES5 #15620

Merged
merged 1 commit into from
Sep 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions packages/angular/cli/bin/postinstall/analytics-prompt.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
'use strict';
// This file is ES6 because it needs to be executed as is.
// This file is ES5 because it needs to be executed as is.

if ('NG_CLI_ANALYTICS' in process.env) {
if (process.env['NG_CLI_ANALYTICS'] !== undefined) {
return;
}

(async () => {
try {
const analytics = require('../../models/analytics');
try {
var analytics = require('../../models/analytics');

if (!analytics.hasGlobalAnalyticsConfiguration()) {
await analytics.promptGlobalAnalytics();
}
} catch (_) {}
})();
if (!analytics.hasGlobalAnalyticsConfiguration()) {
analytics.promptGlobalAnalytics().catch(function() { });
}
} catch (_) {}