title: Gulp has 2 tasks conflicting with each other
body: <p>I have both javascript and css files that I am using a forked repo of gulp-rev lib[1] that both renames the files and updates the file references within the html file.</p>
  
  <p>Unfortunately, there is a race condition between the two tasks resulting in either the stylesheet reference to the md5-named file OR the js files winning out.</p>
  
  <p>I have tried to use promises as well as callbacks (see below) to allow for syncing of the tasks, but never are both of the css and js md5 references made.</p>
  
  <p>sindresorhus's lib only renames the files and does not fix the links, so is there a better way to fix the html links, or is using the forked plugin they way to go (with some fixes that I am missing)?</p>
  
  <pre><code>gulp.task('rev', ['rev-js'] );
  gulp.task('rev-js', ['rev-css'], function(cb) {
    var context = rev.Context();
    gulp.src(['./build/public/js/woddy.js', './build/public/js/angular.js', './build/public/js/components.js'])
      .pipe(rev(context))
      .pipe(gulp.dest('./build/public/js'));
    gulp.src('./build/public/app.html')
      .pipe(context.replace(/src="js\/(\w+\.js)"/g, 'src="js/{{$1}}"'))
      .pipe(gulp.dest('./build/public'));
  });
  gulp.task('rev-css', function() {
    var context = rev.Context();
    gulp.src('./build/public/styles/woddy.css')
      .pipe(rev(context))
      .pipe(gulp.dest('./build/public/styles'));
    gulp.src('./build/public/app.html')
      .pipe(context.replace(/href="styles\/(\w+\.css)"/g, 'href="styles/{{$1}}"'))
      .pipe(gulp.dest('./build/public'));
  });
  </code></pre>
  
  <ol>
  <li><a href="https://github.com/dtinth/gulp-rev" rel="nofollow">https://github.com/dtinth/gulp-rev</a></li>
  </ol>