@@ -23,7 +23,8 @@ function generateUpdateFunction( repo, directory, sha, ref ) {
23
23
opts : { cwd : config . working }
24
24
} , function ( err ) {
25
25
if ( err ) {
26
- callback ( err ) ;
26
+ console . log ( "There was an error exporting the SHA:\n" + err ) ;
27
+ return callback ( err ) ;
27
28
}
28
29
if ( buildCommand ) {
29
30
console . log ( "Running build command" ) ;
@@ -83,7 +84,15 @@ module.exports = function( callback ) {
83
84
callback ( ) ;
84
85
} ;
85
86
}
86
- return generateUpdateFunction ( repo , tag . name , tag . sha , "refs/tags/" + tag . name ) ;
87
+ return function ( callback ) {
88
+ generateUpdateFunction ( repo , tag . name , tag . sha , "refs/tags/" + tag . name ) ( function ( err ) {
89
+ if ( err ) {
90
+ delete thisrun . tags [ tag . name ] ;
91
+ return callback ( ) ;
92
+ }
93
+ callback . apply ( this , arguments ) ;
94
+ } ) ;
95
+ } ;
87
96
} ) , callback ) ;
88
97
} , function ( results , callback ) {
89
98
repo . branches ( callback ) ;
@@ -108,7 +117,15 @@ module.exports = function( callback ) {
108
117
callback ( ) ;
109
118
} ;
110
119
}
111
- return generateUpdateFunction ( repo , branch . name , branch . sha , "refs/heads/" + branch . name ) ;
120
+ return function ( callback ) {
121
+ generateUpdateFunction ( repo , branch . name , branch . sha , "refs/heads/" + branch . name ) ( function ( err ) {
122
+ if ( err ) {
123
+ delete thisrun . branches [ branch . name ] ;
124
+ return callback ( ) ;
125
+ }
126
+ callback . apply ( this , arguments ) ;
127
+ } ) ;
128
+ } ;
112
129
} ) , callback ) ;
113
130
114
131
} , function ( results , callback ) {
0 commit comments