2013-04-20 62 views
0

以下的CoffeeScript cakefile不显示任何输出:如何纠正CoffeeScript的蛋糕文件

{exec} = require 'child_process' 
task 'watch', 'watch current directory and corrects the map file', (cb)-> 
    console.log 'hello world' 
    exec 'coffee -w -b -m -c .' ,(err,stdout,stderr) -> 
     console.log err 
     console.log stdout 
     throw err if err 
     console.log stdout + stderr 

它编译所有的文件,但是当我提出在咖啡文件中的错误,它不会引发错误也没有显示任何有关编译文件。但是,exec命令在单独尝试时确实会显示错误。

回答

0

尝试产生而不是exec。我的猜测是exec期待一个缓冲区,但咖啡正在发送一个流。