Skip to content

Commit

Permalink
Fix coffee-streamline script also.
Browse files Browse the repository at this point in the history
  • Loading branch information
aseemk committed May 3, 2011
1 parent 40212c1 commit 1ac254f
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions bin/coffee-streamline
@@ -1,25 +1,10 @@
#!/usr/bin/env node

var coffee = require('coffee-script');
var fs = require('fs');
var path = require('path');

var streamline = require('streamline');

var compile = coffee.compile;
coffee.compile = function(content, options) {
var result = compile(content, options);
return content.indexOf('!!STREAMLINE!!') >= 0 ? streamline.transform.transform(result, { coffee: true }) : result;
}

if (require.extensions) {
require.extensions[".coffee"] = function(module, filename){
var content = fs.readFileSync(filename, 'utf8');
content = coffee.compile(content, {});
module._compile(content, filename);
};
}

if (process.argv.length >= 3 && process.argv[2][0] != '-') {
// coffee-streamline myScript.coffee args
// our compile hook is not called if we pass it to coffee-script command line
Expand Down

0 comments on commit 1ac254f

Please sign in to comment.