title: Get current file name in Gulp Stream
body: <p>I've read <a href="https://stackoverflow.com/questions/21806925/get-the-current-file-name-in-gulp-src">Get the current file name in gulp.src()</a>, and it seems like it's approaching what I am attempting to do, but I need help.</p>
  
  <p>Consider the following function in a <code>gulpfile.js</code>:</p>
  
  <pre><code>function inline() {
    return gulp.src('dist/**/*.html')
      .pipe($.if(PRODUCTION, inliner('dist/css/app.css')))
      .pipe(gulp.dest('dist'));
  }
  </code></pre>
  
  <p>And <code>inliner()</code>, to be thorough (also in the <code>gulpfile</code>):</p>
  
  <pre><code>function inliner(css) {
    var css = fs.readFileSync(css).toString();
    var mqCss = siphon(css);
  
    var pipe = lazypipe()
      .pipe($.inlineCss, {
        applyStyleTags: false,
        removeStyleTags: false,
        removeLinkTags: false
      })
      .pipe($.replace, '&lt;!-- &lt;style&gt; --&gt;', `&lt;style&gt;${mqCss}&lt;/style&gt;`);
  
    return pipe();
  }
  </code></pre>
  
  <p>These functions take an external CSS file and inline them into the respective HTML for email.</p>
  
  <p>I <strong>really</strong> want to know how to do something like this:</p>
  
  <pre><code>function inline() {
    return gulp.src('dist/**/*.html')
      .pipe($.if(PRODUCTION, inliner('dist/css/' + file.name + '.css')))
      .pipe(gulp.dest('dist'));
  }
  </code></pre>
  
  <p>And you might ask yourself, "why?" Well, I don't have just one CSS file. If everything from <code>app.css</code> was to be inlined, there would be a lot more styles applied than were actually necessary.</p>
  
  <p>So I want to inline:</p>
  
  <pre><code>email1.css    ----  to  -------&gt;    email1.html
  email2.css    ----  to  -------&gt;    email2.html
  email3.css    ----  to  -------&gt;    email3.html
  </code></pre>
  
  <p>And so on. Essentially, I want to get the name of the HTML file being processed at that moment in the Gulp Stream, save it as a variable, and then pass it into the <code>inliner('dist/css/' + file.name + '.css')</code> bit. I've exhausted every bit of Gulp Knowledge I have and have come up completely and utterly blank.</p>