@@ -10,6 +10,9 @@ module.exports = function stop(args) {
1010 let bsConfigPath = utils . getConfigPath ( args . cf ) ;
1111
1212 return utils . validateBstackJson ( bsConfigPath ) . then ( function ( bsConfig ) {
13+ // setting setDefaultAuthHash to {} if not present and set via env variables or via args.
14+ utils . setDefaultAuthHash ( bsConfig , args ) ;
15+
1316 // accept the username from command line if provided
1417 utils . setUsername ( bsConfig , args ) ;
1518
@@ -18,6 +21,9 @@ module.exports = function stop(args) {
1821
1922 utils . setUsageReportingFlag ( bsConfig , args . disableUsageReporting ) ;
2023
24+ // set cypress config filename
25+ utils . setCypressConfigFilename ( bsConfig , args ) ;
26+
2127 let buildId = args . _ [ 1 ] ;
2228
2329 let options = {
@@ -27,7 +33,7 @@ module.exports = function stop(args) {
2733 password : bsConfig . auth . access_key ,
2834 } ,
2935 headers : {
30- " User-Agent" : utils . getUserAgent ( ) ,
36+ ' User-Agent' : utils . getUserAgent ( ) ,
3137 } ,
3238 } ;
3339
@@ -43,16 +49,16 @@ module.exports = function stop(args) {
4349
4450 logger . info ( message ) ;
4551 } else {
46- let build = null
52+ let build = null ;
4753 try {
48- build = JSON . parse ( body )
54+ build = JSON . parse ( body ) ;
4955 } catch ( error ) {
50- build = null
56+ build = null ;
5157 }
5258
5359 if ( resp . statusCode == 299 ) {
5460 messageType = Constants . messageTypes . INFO ;
55- errorCode = " api_deprecated" ;
61+ errorCode = ' api_deprecated' ;
5662
5763 if ( build ) {
5864 message = build . message ;
@@ -63,14 +69,14 @@ module.exports = function stop(args) {
6369 }
6470 } else if ( resp . statusCode != 200 ) {
6571 messageType = Constants . messageTypes . ERROR ;
66- errorCode = " api_failed_build_stop" ;
72+ errorCode = ' api_failed_build_stop' ;
6773
6874 if ( build ) {
6975 message = `${
7076 Constants . userMessages . BUILD_STOP_FAILED
7177 } with error: \n${ JSON . stringify ( build , null , 2 ) } `;
7278 logger . error ( message ) ;
73- if ( build . message === " Unauthorized" ) errorCode = " api_auth_failed" ;
79+ if ( build . message === ' Unauthorized' ) errorCode = ' api_auth_failed' ;
7480 } else {
7581 message = Constants . userMessages . BUILD_STOP_FAILED ;
7682 logger . error ( message ) ;
@@ -82,7 +88,7 @@ module.exports = function stop(args) {
8288 }
8389 }
8490 utils . sendUsageReport ( bsConfig , args , message , messageType , errorCode ) ;
85- } )
91+ } ) ;
8692 } ) . catch ( function ( err ) {
8793 logger . error ( err ) ;
8894 utils . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
0 commit comments