@@ -18,6 +18,7 @@ const archiver = require("../helpers/archiver"),
18
18
pkg = require ( '../../package.json' ) ;
19
19
module . exports = function run ( args ) {
20
20
let bsConfigPath = utils . getConfigPath ( args . cf ) ;
21
+ let rawArgs = args ;
21
22
//Delete build_results.txt from log folder if already present.
22
23
initTimeComponents ( ) ;
23
24
instrumentEventTime ( "cliStart" )
@@ -176,7 +177,7 @@ module.exports = function run(args) {
176
177
177
178
// Generate custom report!
178
179
reportGenerator ( bsConfig , data . build_id , args , function ( ) {
179
- utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData ) ;
180
+ utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData , rawArgs ) ;
180
181
utils . handleSyncExit ( exitCode , data . dashboard_url ) ;
181
182
} ) ;
182
183
} ) ;
@@ -203,30 +204,30 @@ module.exports = function run(args) {
203
204
}
204
205
}
205
206
buildReportData = { ...buildReportData , ...dataToSend } ;
206
- utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData ) ;
207
+ utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData , rawArgs ) ;
207
208
return ;
208
209
} ) . catch ( async function ( err ) {
209
210
// Build creation failed
210
211
logger . error ( err ) ;
211
212
// stop the Local instance
212
213
await utils . stopLocalBinary ( bsConfig , bs_local , args ) ;
213
214
214
- utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' ) ;
215
+ utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' , null , rawArgs ) ;
215
216
process . exitCode = Constants . ERROR_EXIT_CODE ;
216
217
} ) ;
217
218
} ) . catch ( function ( err ) {
218
219
// Zip Upload failed | Local Start failed
219
220
logger . error ( err ) ;
220
221
if ( err === Constants . userMessages . LOCAL_START_FAILED ) {
221
- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . LOCAL_START_FAILED } ` , Constants . messageTypes . ERROR , 'local_start_failed' ) ;
222
+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . LOCAL_START_FAILED } ` , Constants . messageTypes . ERROR , 'local_start_failed' , null , rawArgs ) ;
222
223
} else {
223
224
logger . error ( Constants . userMessages . ZIP_UPLOAD_FAILED ) ;
224
225
fileHelpers . deleteZip ( ) ;
225
- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' ) ;
226
+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' , null , rawArgs ) ;
226
227
try {
227
228
fileHelpers . deletePackageArchieve ( ) ;
228
229
} catch ( err ) {
229
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' ) ;
230
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' , null , rawArgs ) ;
230
231
}
231
232
}
232
233
process . exitCode = Constants . ERROR_EXIT_CODE ;
@@ -235,36 +236,36 @@ module.exports = function run(args) {
235
236
// Zipping failed
236
237
logger . error ( err ) ;
237
238
logger . error ( Constants . userMessages . FAILED_TO_ZIP ) ;
238
- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . FAILED_TO_ZIP } ` , Constants . messageTypes . ERROR , 'zip_creation_failed' ) ;
239
+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . FAILED_TO_ZIP } ` , Constants . messageTypes . ERROR , 'zip_creation_failed' , null , rawArgs ) ;
239
240
try {
240
241
fileHelpers . deleteZip ( ) ;
241
242
} catch ( err ) {
242
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' ) ;
243
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' , null , rawArgs ) ;
243
244
}
244
245
try {
245
246
fileHelpers . deletePackageArchieve ( ) ;
246
247
} catch ( err ) {
247
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' ) ;
248
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' , null , rawArgs ) ;
248
249
}
249
250
process . exitCode = Constants . ERROR_EXIT_CODE ;
250
251
} ) ;
251
252
} ) . catch ( function ( err ) {
252
253
// package installer failed
253
254
logger . error ( err ) ;
254
255
logger . error ( Constants . userMessages . FAILED_CREATE_NPM_ARCHIVE ) ;
255
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . FAILED_CREATE_NPM_ARCHIVE , Constants . messageTypes . ERROR , 'npm_package_archive_failed' ) ;
256
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . FAILED_CREATE_NPM_ARCHIVE , Constants . messageTypes . ERROR , 'npm_package_archive_failed' , null , rawArgs ) ;
256
257
try {
257
258
fileHelpers . deletePackageArchieve ( ) ;
258
259
} catch ( err ) {
259
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' ) ;
260
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' , null , rawArgs ) ;
260
261
}
261
262
process . exitCode = Constants . ERROR_EXIT_CODE ;
262
263
} ) ;
263
264
} ) . catch ( function ( err ) {
264
265
// md5 check failed
265
266
logger . error ( err ) ;
266
267
logger . error ( Constants . userMessages . FAILED_MD5_CHECK ) ;
267
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . MD5_CHECK_FAILED , Constants . messageTypes . ERROR , 'zip_already_uploaded_failed' ) ;
268
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . MD5_CHECK_FAILED , Constants . messageTypes . ERROR , 'zip_already_uploaded_failed' , null , rawArgs ) ;
268
269
process . exitCode = Constants . ERROR_EXIT_CODE ;
269
270
} ) ;
270
271
} ) . catch ( function ( err ) {
@@ -278,14 +279,14 @@ module.exports = function run(args) {
278
279
}
279
280
280
281
let error_code = utils . getErrorCodeFromMsg ( err ) ;
281
- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code ) ;
282
+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code , null , rawArgs ) ;
282
283
process . exitCode = Constants . ERROR_EXIT_CODE ;
283
284
} ) ;
284
285
} ) . catch ( function ( err ) {
285
286
logger . error ( err ) ;
286
287
utils . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
287
288
let bsJsonData = utils . readBsConfigJSON ( bsConfigPath ) ;
288
- utils . sendUsageReport ( bsJsonData , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) ) ;
289
+ utils . sendUsageReport ( bsJsonData , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) , null , rawArgs ) ;
289
290
process . exitCode = Constants . ERROR_EXIT_CODE ;
290
291
} ) . finally ( function ( ) {
291
292
updateNotifier ( {
0 commit comments