Skip to content

Commit f64bced

Browse files
committed
don't abort for failed sha's, just defer to next run
1 parent 95a8929 commit f64bced

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

lib/update.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function generateUpdateFunction( repo, directory, sha, ref ) {
2323
opts: { cwd: config.working }
2424
}, function( err ) {
2525
if ( err ) {
26-
callback( err );
26+
console.log( "There was an error exporting the SHA:\n" + err );
27+
return callback( err );
2728
}
2829
if ( buildCommand ) {
2930
console.log( "Running build command" );
@@ -83,7 +84,15 @@ module.exports = function( callback ) {
8384
callback();
8485
};
8586
}
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+
};
8796
}), callback );
8897
}, function( results, callback ) {
8998
repo.branches( callback );
@@ -108,7 +117,15 @@ module.exports = function( callback ) {
108117
callback();
109118
};
110119
}
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+
};
112129
}), callback );
113130

114131
}, function( results, callback ) {

0 commit comments

Comments
 (0)