【问题标题】:Compass - Changing default of "compass watch"指南针 - 更改“指南针手表”的默认值
【发布时间】:2013-12-20 20:17:00
【问题描述】:

使用 SASS,您需要创建一个 config.rb 来管理应用程序的位置。我最近将此文件的名称更改为“sass_config.rb”,但不知道如何更改“compass watch”的默认值,以便它找到我重命名的文件。

为了澄清,当我运行以下命令时,罗盘正确地找到了文件并继续其正常行为:

compass -c watch sass_config.rb

但是当我跑步时:

compass watch

上面写着:

Nothing to compile. If you're trying to start a new project, 
you have left off the directory argument.

我怎样才能解决这个问题,让它看到文件已被重命名,只是运行“compass watch”?

【问题讨论】:

  • 为什么需要重命名 config.rb?
  • 我在目录中有另一个 config.yml 文件,只是想弄清楚 config.rb 的用途......
  • config.rb 和 config.yml 听起来并不冲突。适当的修复似乎是“将名称恢复原状”。
  • 那么就不能改名了吗?显然我可以这样做,但这不是我要问的......

标签: sass compass-sass


【解决方案1】:

不能随意修改配置文件名。它在 Compass 中被硬编码为位于 5 个位置之一(很快将是 4 个)。

https://github.com/chriseppstein/compass/blob/192107cb4f17bef52fdd8c0d961fe77f3edb44c4/lib/compass/configuration/helpers.rb#L137

# TODO: Deprecate the src/config.rb location.
KNOWN_CONFIG_LOCATIONS = ['config/compass.rb', ".compass/config.rb", "config/compass.config", "config.rb", "src/config.rb"]

【讨论】:

  • 太棒了!非常感谢您的帮助!
【解决方案2】:

只需创建一个指南针项目

compass create

之后,您将 OLD config.rb 内容复制到从 copass 创建的内容中。

现在试试

compass watch

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-25
    • 2015-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多