简体   繁体   English

如何配置Compass在Windows上使用Unix行结尾生成文件?

[英]How to configure Compass to generate files with Unix line endings on Windows?

I just installed Compass 0.11.5 on Windows 7 with Ruby 1.9.2. 我刚刚在Windows 7上使用Ruby 1.9.2安装了Compass 0.11.5。

I have my development environment set up to use Unix line endings for all files. 我的开发环境设置为对所有文件使用Unix行结尾。

I created an initial sass-test project and noticed that all the files it created had Windows line endings. 我创建了一个初始的sass-test项目,并注意到它创建的所有文件都有Windows行结尾。 I moved an existing .css file from another project (with unix line endings) into the sass folder and changed the extension to .scss. 我将现有的.css文件从另一个项目(带有unix行结尾)移动到sass文件夹中,并将扩展名更改为.scss。 I ran the 'compass compile' command to generate the .css file for this new file and the .css file it created had Windows line endings. 我运行'compass compile'命令为这个新文件生成.css文件,它创建的.css文件有Windows行结尾。

I can't find any configuration options in the Compass documentation to force Compass to generate files with Unix line endings. 我在Compass文档中找不到任何配置选项来强制Compass生成带有Unix行结尾的文件。

Is it possible to configure Compass to generate files with Unix line endings on Windows? 是否可以将Compass配置为在Windows上生成带有Unix行结尾的文件?

Update 更新

After further investigation, there is an option to to pass configuration options to Sass from Compass. 经过进一步调查后,可以选择将配置选项从Compass传递给Sass。

Property Name   Type    Description
sass_options    Hash    These options are passed directly to the Sass compiler. For more details on the format of sass options, please read the sass options documentation.

Sass has an option for generating unix line endings: Sass有一个生成unix行结尾的选项:

:unix_newlines :unix_newlines
If true, use Unix-style newlines when writing files. 如果为true,则在编写文件时使用Unix样式的换行符。 Only has meaning on Windows, and only when Sass is writing the files (in Rack, Rails, or Merb, when using Sass::Plugin directly, or when using the command-line executable). 只有在Windows上有意义,并且只有当Sass正在编写文件时(在Rack,Rails或Merb中,直接使用Sass :: Plugin时,或者在使用命令行可执行文件时)。

It appears that adding the following line to the sass-test project's config.rb file should solve the issue: 似乎将以下行添加到sass-test项目的config.rb文件应该可以解决问题:

sass_options = {:unix_newlines => true}

But, it doesn't have any effect on the resulting .css files created - they still have Windows line endings. 但是,它对创建的.css文件没有任何影响 - 它们仍然具有Windows行结尾。

根据https://github.com/chriseppstein/compass/issues/949它应该在sass 3.1.20中修复但在我的盒子上没有快乐...仍然是Windows行结尾

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM