mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-17 11:01:25 -05:00
updating for Node.js' change from 'posix' to 'fs'
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
(function(){
|
||||
var BANNER, SWITCHES, WATCH_INTERVAL, coffee, compile, compile_scripts, lint, option_parser, options, optparse, parse_options, path, posix, sources, usage, version, write_js;
|
||||
posix = require('posix');
|
||||
var BANNER, SWITCHES, WATCH_INTERVAL, coffee, compile, compile_scripts, fs, lint, option_parser, options, optparse, parse_options, path, sources, usage, version, write_js;
|
||||
fs = require('fs');
|
||||
path = require('path');
|
||||
coffee = require('coffee-script');
|
||||
optparse = require('optparse');
|
||||
@@ -66,7 +66,7 @@
|
||||
return null;
|
||||
}
|
||||
opts = options;
|
||||
return posix.cat(source).addCallback(function(code) {
|
||||
return fs.cat(source).addCallback(function(code) {
|
||||
var js;
|
||||
if (opts.tokens) {
|
||||
puts(coffee.print_tokens(coffee.tokenize(code)));
|
||||
@@ -93,8 +93,8 @@
|
||||
filename = path.basename(source, path.extname(source)) + '.js';
|
||||
dir = options.output || path.dirname(source);
|
||||
js_path = path.join(dir, filename);
|
||||
return posix.open(js_path, process.O_CREAT | process.O_WRONLY | process.O_TRUNC, parseInt('0755', 8)).addCallback(function(fd) {
|
||||
return posix.write(fd, js);
|
||||
return fs.open(js_path, process.O_CREAT | process.O_WRONLY | process.O_TRUNC, parseInt('0755', 8)).addCallback(function(fd) {
|
||||
return fs.write(fd, js);
|
||||
});
|
||||
};
|
||||
// Pipe compiled JS through JSLint (requires a working 'jsl' command).
|
||||
|
||||
Reference in New Issue
Block a user