如何从 Rake 文件、Make 文件或这些文件的某种组合调用 Cake 文件?
所以,我有一个用于构建我的 Coffeescript 的蛋糕文件(感谢 https://github.com/krismolendyke/InstantJasmineCoffee)。我还有一个充满基于 Compass 的 SCSS 的目录,我用快速“compass 编译”来调用它,它来自 Ruby gem。
有没有办法从我的 Cake 文件中调用“指南针编译”,或者从 Rake 文件中调用我的 Cake 文件,或者可以同时执行这两种操作的 Make 文件,或者完全是其他东西?完成所有编辑的最简单方法是什么?
So, I have a cake file for building my Coffeescript (thanks to https://github.com/krismolendyke/InstantJasmineCoffee). I also have a directory full of SCSS based on Compass, which I call with a quick "compass compile," which comes from a Ruby gem.
Is there a way to call "compass compile" from within my Cake file, or a way to call my Cake file from within a Rake file, or a Make file that can do both, or something else entirely? What's the easiest way to do all of my compilations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于 Rakefile 只是 ruby 源,因此您可以使用
system
,例如。As a Rakefile is just ruby source, you can use
system
, eg.radiospiel 展示了如何从
Rake
文件运行compass
或cake
。要从Cakefile
调用compass
或rake
,您需要编写如下内容:(将
compasscompile
替换为无论您想要运行什么系统命令。)请注意,默认情况下,这将抑制命令的输出;您可能应该使用回调来记录该输出。有关详细信息,请参阅 child_process.exec 上的节点文档。radiospiel has shown how you could run
compass
orcake
from aRake
file. To callcompass
orrake
from aCakefile
, you'd write something like this:(Replace
compass compile
with whatever system command you want to run.) Note that this would, by default, suppress the output from the command; you should probably use a callback to log that output. See the Node docs on child_process.exec for details.