I am trying to get a script rolling that:
- clones a repo (e.g. git clone someClonePath.git), then
- checks out a tag (git checkout tags/someTag)
gulp.task('clone', function(){ git.clone('somepath/cloneDir.git', function (err) { if (err) { throw err; } }); }); gulp.task('checkout',['clone'], function(){ process.chdir('./cloneDir'); git.checkout('tags/' + argv.tag,function (err) { if (err) { throw err; } }); });
The checkout completes (fails) before the clone does. The problem here lies with my understanding of async tasks in gulp. How can I verify that the clone has succeeded to 'cloneDir' prior to checking out a tag using gulp-git?