如何从 Rake 文件、Make 文件或这些文件的某种组合调用 Cake 文件?

发布于 2024-11-16 02:56:22 字数 363 浏览 2 评论 0原文

所以,我有一个用于构建我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

栖迟 2024-11-23 02:56:22

由于 Rakefile 只是 ruby​​ 源,因此您可以使用 system,例如。

description "Compile"
task :compile do
    system "compass compile"
end 

As a Rakefile is just ruby source, you can use system, eg.

description "Compile"
task :compile do
    system "compass compile"
end 
沫雨熙 2024-11-23 02:56:22

radiospiel 展示了如何从 Rake 文件运行 compasscake。要从 Cakefile 调用 compassrake,您需要编写如下内容:(

{exec} = require 'child_process'
exec 'compass compile'

compasscompile 替换为无论您想要运行什么系统命令。)请注意,默认情况下,这将抑制命令的输出;您可能应该使用回调来记录该输出。有关详细信息,请参阅 child_process.exec 上的节点文档。

radiospiel has shown how you could run compass or cake from a Rake file. To call compass or rake from a Cakefile, you'd write something like this:

{exec} = require 'child_process'
exec 'compass compile'

(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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文