'use srict';

var concat = require('gulp-concat'),
  es = require('event-stream'),
  filter = require('gulp-filter'),
  less = require('gulp-less'),
  sass = require('gulp-sass'),
  vfs = require('vinyl-fs'),
  plumber = require('gulp-plumber');

module.exports = {
  // Processes all SASS/LESS/CSS files and combine to a single file
  getStream: function(files, opt) {
    var sassStream,
    lessStream,
    cssStream,
    originalSassOnError = opt.sass.onError;

    opt.sass.onError = function(err) {
      console.error('An error occurred when compiling SASS');
      console.error(err.toString());
      // TODO: Emit event to UI
      // Call original error handler if there was one
      if (typeof originalSassOnError === 'function') {
        originalSassOnError(err);
      }
    }

    var sassSrc = opt.sass.src ? opt.sass.src : files;
    sassStream = vfs.src(files)
      .pipe(filter('**/*.scss'))
      .pipe(sass(opt.sass))
      .pipe(concat('sass.css'));

    var lessSrc = opt.less.src ? opt.less.src : files;
    lessStream = vfs.src(files)
      .pipe(filter('**/*.less'))
      .pipe(less(opt.less))
      .on('error', function(err) {
        console.error('An error occurred when compiling LESS');
        console.error(err.toString());
      })
      .pipe(concat('less.css'));

    cssStream = vfs.src(files)
      .pipe(filter('**/*.css'))
      .pipe(concat('css.css'));

    return es.merge(sassStream, lessStream, cssStream)
      .pipe(concat('styleguide.css'));
  }

}

@@ -795,37 +795,29 @@
     
-var 
 sassS
-rc = opt.sas
+tream = vf
 s.src
- ? 
+(
 opt.
@@ -829,42 +829,11 @@
 src 
-: files;%0A    sassStream = vfs.src(
+%7C%7C 
 file
@@ -934,63 +934,8 @@
 );%0A%0A
-    var lessSrc = opt.less.src ? opt.less.src : files;%0A
     
@@ -947,32 +947,48 @@
 tream = vfs.src(
+opt.less.src %7C%7C 
 files)%0A      .pi

Fix sass and less src parameter handling