title: chaining gulp tasks and passing variables
body: <p>I'm trying to build up a gulp task which sorts my javascript files into the proper order before concatenating them. </p>
  
  <p>This means 1-> get the installed bower components, 2-> sort the components into the include order, 3-> pass the sorted array of files to the concat method.</p>
  
  <p>So far, I've managed this</p>
  
  <pre><code>var gulp = require('gulp');
  var dependency_orderer = require('dependency-orderer');
  var exec = require('child_process').exec;
  
  var bower_list, depend_array, js_depend_array;
  gulp.task('order-dependencies',['get-bower-list'], function(){
      console.log(bower_list);
   //   depend_array = dependency_orderer(bower_list);
      //console.log(depend_array);
  //    return depend_array;
  });
  
  gulp.task('get-bower-list', function(){
      exec('bower list -p', function(err, stdout, stderr){
          if(err) return console.log(err);
          bower_list = stdout;
          console.log(bower_list);
          return bower_list;
      });
  
  });
  gulp.task('concat-files',['order-dependencies'], function(){
  
  
  });
  </code></pre>
  
  <p>But the problem is that I can't seem to get my <code>bower_list</code> in the <code>order-dependencies</code> task. </p>
  
  <p>Any suggestions on how to accomplish this?</p>