@@ -8,7 +8,7 @@ const archiver = require("../helpers/archiver"),
88 config = require ( "../helpers/config" ) ,
99 capabilityHelper = require ( "../helpers/capabilityHelper" ) ,
1010 Constants = require ( "../helpers/constants" ) ,
11- util = require ( "../helpers/util " ) ;
11+ utils = require ( "../helpers/utils " ) ;
1212
1313module . exports = function run ( args ) {
1414 return runCypress ( args ) ;
@@ -27,8 +27,8 @@ function deleteZip() {
2727function runCypress ( args ) {
2828 let bsConfigPath = process . cwd ( ) + args . cf ;
2929
30- util . validateBstackJson ( bsConfigPath ) . then ( function ( bsConfig ) {
31- util . setUsageReportingFlag ( bsConfig , args . disableUsageReporting ) ;
30+ utils . validateBstackJson ( bsConfigPath ) . then ( function ( bsConfig ) {
31+ utils . setUsageReportingFlag ( bsConfig , args . disableUsageReporting ) ;
3232
3333 // Validate browserstack.json values
3434 capabilityHelper . validate ( bsConfig ) . then ( function ( validated ) {
@@ -43,43 +43,43 @@ function runCypress(args) {
4343 // Create build
4444 build . createBuild ( bsConfig , zip ) . then ( function ( message ) {
4545 logger . info ( message ) ;
46- util . sendUsageReport ( bsConfig , args , message , Constants . messageTypes . SUCCESS , null ) ;
46+ utils . sendUsageReport ( bsConfig , args , message , Constants . messageTypes . SUCCESS , null ) ;
4747 return ;
4848 } ) . catch ( function ( err ) {
4949 // Build creation failed
5050 logger . error ( err ) ;
51- util . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' ) ;
51+ utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' ) ;
5252 } ) ;
5353 } ) . catch ( function ( err ) {
5454 // Zip Upload failed
5555 logger . error ( err )
5656 logger . error ( Constants . userMessages . ZIP_UPLOAD_FAILED )
57- util . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' ) ;
57+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' ) ;
5858 } ) . finally ( function ( ) {
5959 deleteZip ( ) ;
6060 } ) ;
6161 } ) . catch ( function ( err ) {
6262 // Zipping failed
6363 logger . error ( err ) ;
6464 logger . error ( Constants . userMessages . FAILED_TO_ZIP ) ;
65- util . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . FAILED_TO_ZIP } ` , Constants . messageTypes . ERROR , 'zip_creation_failed' ) ;
65+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . FAILED_TO_ZIP } ` , Constants . messageTypes . ERROR , 'zip_creation_failed' ) ;
6666 try {
6767 deleteZip ( ) ;
6868 } catch ( err ) {
69- util . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' ) ;
69+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' ) ;
7070 }
7171 } ) ;
7272 } ) . catch ( function ( err ) {
7373 // browerstack.json is not valid
7474 logger . error ( err ) ;
7575 logger . error ( Constants . validationMessages . NOT_VALID ) ;
7676
77- let error_code = util . getErrorCodeFromMsg ( err ) ;
78- util . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code ) ;
77+ let error_code = utils . getErrorCodeFromMsg ( err ) ;
78+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code ) ;
7979 } ) ;
8080 } ) . catch ( function ( err ) {
8181 logger . error ( err ) ;
82- util . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
83- util . sendUsageReport ( null , args , err . message , Constants . messageTypes . ERROR , util . getErrorCodeFromErr ( err ) ) ;
82+ utils . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
83+ utils . sendUsageReport ( null , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) ) ;
8484 } )
8585}
0 commit comments