@@ -18,6 +18,7 @@ const archiver = require("../helpers/archiver"),
1818 pkg = require ( '../../package.json' ) ;
1919module . exports = function run ( args ) {
2020 let bsConfigPath = utils . getConfigPath ( args . cf ) ;
21+ let rawArgs = args ;
2122 //Delete build_results.txt from log folder if already present.
2223 initTimeComponents ( ) ;
2324 instrumentEventTime ( "cliStart" )
@@ -176,7 +177,7 @@ module.exports = function run(args) {
176177
177178 // Generate custom report!
178179 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 ) ;
180181 utils . handleSyncExit ( exitCode , data . dashboard_url ) ;
181182 } ) ;
182183 } ) ;
@@ -203,30 +204,30 @@ module.exports = function run(args) {
203204 }
204205 }
205206 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 ) ;
207208 return ;
208209 } ) . catch ( async function ( err ) {
209210 // Build creation failed
210211 logger . error ( err ) ;
211212 // stop the Local instance
212213 await utils . stopLocalBinary ( bsConfig , bs_local , args ) ;
213214
214- utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' ) ;
215+ utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' , null , rawArgs ) ;
215216 process . exitCode = Constants . ERROR_EXIT_CODE ;
216217 } ) ;
217218 } ) . catch ( function ( err ) {
218219 // Zip Upload failed | Local Start failed
219220 logger . error ( err ) ;
220221 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 ) ;
222223 } else {
223224 logger . error ( Constants . userMessages . ZIP_UPLOAD_FAILED ) ;
224225 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 ) ;
226227 try {
227228 fileHelpers . deletePackageArchieve ( ) ;
228229 } 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 ) ;
230231 }
231232 }
232233 process . exitCode = Constants . ERROR_EXIT_CODE ;
@@ -235,36 +236,36 @@ module.exports = function run(args) {
235236 // Zipping failed
236237 logger . error ( err ) ;
237238 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 ) ;
239240 try {
240241 fileHelpers . deleteZip ( ) ;
241242 } 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 ) ;
243244 }
244245 try {
245246 fileHelpers . deletePackageArchieve ( ) ;
246247 } 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 ) ;
248249 }
249250 process . exitCode = Constants . ERROR_EXIT_CODE ;
250251 } ) ;
251252 } ) . catch ( function ( err ) {
252253 // package installer failed
253254 logger . error ( err ) ;
254255 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 ) ;
256257 try {
257258 fileHelpers . deletePackageArchieve ( ) ;
258259 } 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 ) ;
260261 }
261262 process . exitCode = Constants . ERROR_EXIT_CODE ;
262263 } ) ;
263264 } ) . catch ( function ( err ) {
264265 // md5 check failed
265266 logger . error ( err ) ;
266267 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 ) ;
268269 process . exitCode = Constants . ERROR_EXIT_CODE ;
269270 } ) ;
270271 } ) . catch ( function ( err ) {
@@ -278,14 +279,14 @@ module.exports = function run(args) {
278279 }
279280
280281 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 ) ;
282283 process . exitCode = Constants . ERROR_EXIT_CODE ;
283284 } ) ;
284285 } ) . catch ( function ( err ) {
285286 logger . error ( err ) ;
286287 utils . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
287288 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 ) ;
289290 process . exitCode = Constants . ERROR_EXIT_CODE ;
290291 } ) . finally ( function ( ) {
291292 updateNotifier ( {
0 commit comments