我正在尝试让 Guard 将我的 CoffeeScript 文件编译为 JS 文件,然后让 Juicer 合并并缩小它们。我使用一个tmp
目录来存储中间 JS 文件。据我了解,这应该有效,但它没有:
guard :coffeescript, :input => "src/coffee", :output => "tmp"
guard :shell do
watch %r{^tmp/.+\.js$} do
system 'juicer', 'merge', 'tmp/app.js', '-sfo', 'js/app.js'
end
end
tmp
CoffeeScript 文件每次被触摸时都会被正确编译到目录中,但是shell
守卫不会触发。
手动启动保护--debug
并更改其中一个 JS 文件tmp
,我在终端中没有得到任何调试行。似乎这些文件没有被监视。
$ guard --debug
18:53:51 - DEBUG - Command execution: which notify-send
18:53:51 - DEBUG - Command execution: emacsclient --eval '1' 2> /dev/null || echo 'N/A'
18:53:51 - INFO - Guard is using TerminalTitle to send notifications.
18:53:51 - DEBUG - Command execution: hash stty
18:53:51 - DEBUG - Guard starts all plugins
18:53:51 - DEBUG - Hook :start_begin executed for Guard::CoffeeScript
18:53:51 - DEBUG - Hook :start_end executed for Guard::CoffeeScript
18:53:51 - DEBUG - Hook :start_begin executed for Guard::Shell
18:53:51 - DEBUG - Hook :start_end executed for Guard::Shell
18:53:51 - INFO - Guard is now watching at '/home/tobia/my_project'
18:53:51 - DEBUG - Start interactor
[1] guard(main)>
^^^ 如果我此时修改 JS 文件/home/tobia/my_project/tmp
,则没有任何反应。
我正在使用来自 Debian stable 的 Ruby 1.9.1、Guard 1.8.2 和 Guard-shell 0.5.1 安装sudo gem install