【问题标题】:How to correct the CoffeeScript cake file如何更正 CoffeeScript 蛋糕文件
【发布时间】:2013-08-04 12:43:50
【问题描述】:

以下 CoffeeScript cakefile 没有显示任何输出:

{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 命令在单独尝试时确实会显示错误。

【问题讨论】:

    标签: coffeescript


    【解决方案1】:

    尝试 spawn 而不是 exec。我的猜测是 exec 期待一个缓冲区,但咖啡正在提供一个流。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-25
      • 2013-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多