mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-17 02:51:25 -05:00
using the new fs.writeFile API instead of fs.open -- much, much nicer
This commit is contained in:
@@ -99,14 +99,12 @@ watch_scripts: ->
|
||||
return if curr.mtime.getTime() is prev.mtime.getTime()
|
||||
fs.readFile(source).addCallback (code) -> compile_script(source, code)
|
||||
|
||||
|
||||
# Write out a JavaScript source file with the compiled code.
|
||||
write_js: (source, js) ->
|
||||
filename: path.basename(source, path.extname(source)) + '.js'
|
||||
dir: options.output or path.dirname(source)
|
||||
js_path: path.join dir, filename
|
||||
fs.open(js_path, 'w+', 0755).addCallback (fd) ->
|
||||
fs.write(fd, js)
|
||||
fs.writeFile js_path, js
|
||||
|
||||
# Pipe compiled JS through JSLint (requires a working 'jsl' command).
|
||||
lint: (js) ->
|
||||
|
||||
Reference in New Issue
Block a user