/*
 * grunt-babelsbergjs
 * 
 *
 * Copyright (c) 2015 Maximilian Grundke
 * Licensed under the MIT license.
 */

'use strict';

var BabelsbergSrcTransform = require("./../node_modules/babelsbergjs-require/src/src_transform.js");

module.exports = function(grunt) {

  grunt.registerMultiTask('babelsbergjs', 'Helper for BabelsbergJS for Node.', function() {

    this.files.forEach(function(f) {
      f.src.forEach(function(filepath) {
        if (!grunt.file.exists(filepath)) {
          grunt.log.warn('Source file "' + filepath + '" not found.');
          
        }
        var content = grunt.file.read(filepath)
        var transformed = new BabelsbergSrcTransform().transform(content);
        var filename = f.dest + filepath.replace(/.*\//, "").replace(".bbb", ".js");
        grunt.file.write(filename, transformed);
      });
    });
  
  });

};

@@ -461,16 +461,24 @@
 .exists(
+f.cwd + 
 filepath
@@ -524,16 +524,24 @@
 ile %22' +
+ f.cwd +
  filepat
@@ -620,16 +620,24 @@
 le.read(
+f.cwd + 
 filepath
@@ -766,28 +766,8 @@
 ace(
-/.*%5C//, %22%22).replace(
 %22.bb

Fix cwd