/*
 * Runs a tsc command.
 *
 * Copyright 2013 Palantir Technologies, Inc. All rights reserved.
 */

module.exports = function(grunt) {
  "use strict";

  grunt.registerMultiTask("tsc", function() {
    var done = this.async();
    var options = this.options();
    var args = "";

    this.files.forEach(function(file) {
      args += "--out " + file.dest;

      file.src.filter(function(filepath) {
        args += " " + filepath;
      });
    });

    grunt.log.write("Running tsc...");
    grunt.util.spawn({
      cmd: options.bin,
      args: [args]
    }, function(err) {
      if (err) {
        grunt.warn("tsc exited unexpectedly with error: " + err.message);
      } else {
        grunt.log.ok();
      }

      done();
    });
  });

};

@@ -274,10 +274,10 @@
 s = 
-%22%22
+%5B%5D
 ;%0A%0A 
@@ -319,45 +319,8 @@
 ) %7B%0A
-      args += %22--out %22 + file.dest;%0A%0A
     
@@ -374,26 +374,22 @@
 args
- += %22 %22 + 
+.push(
 filepath
 ;%0A  
@@ -384,16 +384,17 @@
 filepath
+)
 ;%0A      
@@ -396,16 +396,71 @@
      %7D);
+%0A%0A      args.push(%22--out%22);%0A      args.push(file.dest);
 %0A    %7D);
@@ -563,14 +563,12 @@
 gs: 
-%5B
 args
-%5D
 %0A   

Fix the grunt tsc task (it wasn't working before)