File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,16 @@ module.exports = function run(args) {
12
12
return runCypress ( args ) ;
13
13
}
14
14
15
+ function deleteZip ( ) {
16
+ fs . unlink ( config . fileName , function ( err ) {
17
+ if ( err ) {
18
+ logger . log ( Constants . userMessages . ZIP_DELETE_FAILED ) ;
19
+ } else {
20
+ logger . log ( Constants . userMessages . ZIP_DELETED ) ;
21
+ }
22
+ } ) ;
23
+ }
24
+
15
25
function runCypress ( args ) {
16
26
let bsConfigPath = process . cwd ( ) + args . cf ;
17
27
logger . log ( `Reading config from ${ args . cf } ` ) ;
@@ -30,25 +40,19 @@ function runCypress(args) {
30
40
} ) . catch ( function ( err ) {
31
41
// Build creation failed
32
42
logger . error ( Constants . userMessages . BUILD_FAILED )
33
- } ) . finally ( function ( ) {
34
- // Delete zip file from local storage
35
- fs . unlink ( config . fileName , function ( err ) {
36
- if ( err ) {
37
- logger . log ( Constants . userMessages . ZIP_DELETE_FAILED ) ;
38
- } else {
39
- logger . log ( Constants . userMessages . ZIP_DELETED ) ;
40
- }
41
- } ) ;
42
43
} ) ;
43
44
} ) . catch ( function ( err ) {
44
45
// Zip Upload failed
45
46
logger . error ( err )
46
47
logger . error ( Constants . userMessages . ZIP_UPLOAD_FAILED )
48
+ } ) . finally ( function ( params ) {
49
+ deleteZip ( ) ;
47
50
} ) ;
48
51
} ) . catch ( function ( err ) {
49
52
// Zipping failed
50
53
logger . error ( err )
51
54
logger . error ( Constants . userMessages . FAILED_TO_ZIP )
55
+ deleteZip ( ) ;
52
56
} ) ;
53
57
} ) . catch ( function ( err ) {
54
58
// browerstack.json is not valid
You can’t perform that action at this time.
0 commit comments