@@ -18,7 +18,7 @@ const archiver = require("../helpers/archiver"),
1818 downloadBuildArtifacts = require ( '../helpers/buildArtifacts' ) . downloadBuildArtifacts ,
1919 updateNotifier = require ( 'update-notifier' ) ,
2020 pkg = require ( '../../package.json' ) ;
21- module . exports = function run ( args ) {
21+ module . exports = function run ( args , rawArgs ) {
2222 let bsConfigPath = utils . getConfigPath ( args . cf ) ;
2323 //Delete build_results.txt from log folder if already present.
2424 initTimeComponents ( ) ;
@@ -102,7 +102,7 @@ module.exports = function run(args) {
102102 utils . setParallels ( bsConfig , args , specFiles . length ) ;
103103
104104 // warn if specFiles cross our limit
105- utils . warnSpecLimit ( bsConfig , args , specFiles ) ;
105+ utils . warnSpecLimit ( bsConfig , args , specFiles , rawArgs ) ;
106106 markBlockEnd ( 'preArchiveSteps' ) ;
107107 markBlockStart ( 'checkAlreadyUploaded' ) ;
108108 return checkUploaded . checkUploadedMd5 ( bsConfig , args , { markBlockStart, markBlockEnd} ) . then ( function ( md5data ) {
@@ -130,7 +130,7 @@ module.exports = function run(args) {
130130 // Create build
131131 //setup Local Testing
132132 markBlockStart ( 'localSetup' ) ;
133- let bs_local = await utils . setupLocalTesting ( bsConfig , args ) ;
133+ let bs_local = await utils . setupLocalTesting ( bsConfig , args , rawArgs ) ;
134134 markBlockEnd ( 'localSetup' ) ;
135135 markBlockStart ( 'createBuild' ) ;
136136 return build . createBuild ( bsConfig , zip ) . then ( function ( data ) {
@@ -166,22 +166,22 @@ module.exports = function run(args) {
166166
167167
168168 if ( args . sync ) {
169- syncRunner . pollBuildStatus ( bsConfig , data ) . then ( async ( exitCode ) => {
169+ syncRunner . pollBuildStatus ( bsConfig , data , rawArgs ) . then ( async ( exitCode ) => {
170170
171171 // stop the Local instance
172- await utils . stopLocalBinary ( bsConfig , bs_local , args ) ;
172+ await utils . stopLocalBinary ( bsConfig , bs_local , args , rawArgs ) ;
173173
174174 // waiting for 5 secs for upload to complete (as a safety measure)
175175 await new Promise ( resolve => setTimeout ( resolve , 5000 ) ) ;
176176
177177 // download build artifacts
178178 if ( utils . nonEmptyArray ( bsConfig . run_settings . downloads ) ) {
179- await downloadBuildArtifacts ( bsConfig , data . build_id , args ) ;
179+ await downloadBuildArtifacts ( bsConfig , data . build_id , args , rawArgs ) ;
180180 }
181181
182182 // Generate custom report!
183- reportGenerator ( bsConfig , data . build_id , args , function ( ) {
184- utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData ) ;
183+ reportGenerator ( bsConfig , data . build_id , args , rawArgs , function ( ) {
184+ utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData , rawArgs ) ;
185185 utils . handleSyncExit ( exitCode , data . dashboard_url ) ;
186186 } ) ;
187187 } ) ;
@@ -210,30 +210,30 @@ module.exports = function run(args) {
210210 }
211211 }
212212 buildReportData = { ...buildReportData , ...dataToSend } ;
213- utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData ) ;
213+ utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData , rawArgs ) ;
214214 return ;
215215 } ) . catch ( async function ( err ) {
216216 // Build creation failed
217217 logger . error ( err ) ;
218218 // stop the Local instance
219- await utils . stopLocalBinary ( bsConfig , bs_local , args ) ;
219+ await utils . stopLocalBinary ( bsConfig , bs_local , args , rawArgs ) ;
220220
221- utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' ) ;
221+ utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' , null , rawArgs ) ;
222222 process . exitCode = Constants . ERROR_EXIT_CODE ;
223223 } ) ;
224224 } ) . catch ( function ( err ) {
225225 // Zip Upload failed | Local Start failed
226226 logger . error ( err ) ;
227227 if ( err === Constants . userMessages . LOCAL_START_FAILED ) {
228- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . LOCAL_START_FAILED } ` , Constants . messageTypes . ERROR , 'local_start_failed' ) ;
228+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . LOCAL_START_FAILED } ` , Constants . messageTypes . ERROR , 'local_start_failed' , null , rawArgs ) ;
229229 } else {
230230 logger . error ( Constants . userMessages . ZIP_UPLOAD_FAILED ) ;
231231 fileHelpers . deleteZip ( ) ;
232- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' ) ;
232+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' , null , rawArgs ) ;
233233 try {
234234 fileHelpers . deletePackageArchieve ( ) ;
235235 } catch ( err ) {
236- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' ) ;
236+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' , null , rawArgs ) ;
237237 }
238238 }
239239 process . exitCode = Constants . ERROR_EXIT_CODE ;
@@ -242,36 +242,36 @@ module.exports = function run(args) {
242242 // Zipping failed
243243 logger . error ( err ) ;
244244 logger . error ( Constants . userMessages . FAILED_TO_ZIP ) ;
245- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . FAILED_TO_ZIP } ` , Constants . messageTypes . ERROR , 'zip_creation_failed' ) ;
245+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . FAILED_TO_ZIP } ` , Constants . messageTypes . ERROR , 'zip_creation_failed' , null , rawArgs ) ;
246246 try {
247247 fileHelpers . deleteZip ( ) ;
248248 } catch ( err ) {
249- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' ) ;
249+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' , null , rawArgs ) ;
250250 }
251251 try {
252252 fileHelpers . deletePackageArchieve ( ) ;
253253 } catch ( err ) {
254- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' ) ;
254+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' , null , rawArgs ) ;
255255 }
256256 process . exitCode = Constants . ERROR_EXIT_CODE ;
257257 } ) ;
258258 } ) . catch ( function ( err ) {
259259 // package installer failed
260260 logger . error ( err ) ;
261261 logger . error ( Constants . userMessages . FAILED_CREATE_NPM_ARCHIVE ) ;
262- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . FAILED_CREATE_NPM_ARCHIVE , Constants . messageTypes . ERROR , 'npm_package_archive_failed' ) ;
262+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . FAILED_CREATE_NPM_ARCHIVE , Constants . messageTypes . ERROR , 'npm_package_archive_failed' , null , rawArgs ) ;
263263 try {
264264 fileHelpers . deletePackageArchieve ( ) ;
265265 } catch ( err ) {
266- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' ) ;
266+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' , null , rawArgs ) ;
267267 }
268268 process . exitCode = Constants . ERROR_EXIT_CODE ;
269269 } ) ;
270270 } ) . catch ( function ( err ) {
271271 // md5 check failed
272272 logger . error ( err ) ;
273273 logger . error ( Constants . userMessages . FAILED_MD5_CHECK ) ;
274- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . MD5_CHECK_FAILED , Constants . messageTypes . ERROR , 'zip_already_uploaded_failed' ) ;
274+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . MD5_CHECK_FAILED , Constants . messageTypes . ERROR , 'zip_already_uploaded_failed' , null , rawArgs ) ;
275275 process . exitCode = Constants . ERROR_EXIT_CODE ;
276276 } ) ;
277277 } ) . catch ( function ( err ) {
@@ -285,14 +285,14 @@ module.exports = function run(args) {
285285 }
286286
287287 let error_code = utils . getErrorCodeFromMsg ( err ) ;
288- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code ) ;
288+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code , null , rawArgs ) ;
289289 process . exitCode = Constants . ERROR_EXIT_CODE ;
290290 } ) ;
291291 } ) . catch ( function ( err ) {
292292 logger . error ( err ) ;
293293 utils . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
294294 let bsJsonData = utils . readBsConfigJSON ( bsConfigPath ) ;
295- utils . sendUsageReport ( bsJsonData , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) ) ;
295+ utils . sendUsageReport ( bsJsonData , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) , null , rawArgs ) ;
296296 process . exitCode = Constants . ERROR_EXIT_CODE ;
297297 } ) . finally ( function ( ) {
298298 updateNotifier ( {
0 commit comments