@@ -94,6 +94,30 @@ async function promptSettingsFile(opts) {
9494 return responses ;
9595}
9696
97+ async function promptTelemetry ( ) {
98+ heading ( "Share Anonymouse Usage Information" ) ;
99+
100+ const responses = await prompt ( [
101+ {
102+ type : 'select' ,
103+ name : 'telemetryEnabled' ,
104+ // initial: "Yes",
105+ message : `Node-RED can notify you when there is a new version available.
106+ This ensures you keep up to date with the latest features and fixes.
107+ This requires sending anonymised data back to the Node-RED team.
108+ It does not include any details of your flows or users.
109+ For full information on what information is collected and how it is used,
110+ please see https://nodered.org/docs/telemetry
111+ ` ,
112+ choices : [ 'Yes, send my usage data' , 'No, do not send my usage data' ] ,
113+ result ( value ) {
114+ return / Y e s / . test ( value )
115+ }
116+ }
117+ ] )
118+ return responses
119+ }
120+
97121async function promptUser ( ) {
98122 const responses = await prompt ( [
99123 {
@@ -279,6 +303,9 @@ async function command(argv, result) {
279303
280304 const fileSettings = await promptSettingsFile ( { userDir} ) ;
281305
306+ const telemetryResponses = await promptTelemetry ( )
307+ config . telemetryEnabled = telemetryResponses . telemetryEnabled ? 'true' : 'false'
308+
282309 const securityResponses = await promptSecurity ( ) ;
283310 if ( securityResponses . adminAuth ) {
284311 let adminAuth = {
0 commit comments