将Sass-rails gem升级到5.0会提供弃用警告

我们已升级到sass-rails版本5.0.0,并收到以下弃用警告:

DEPRECATION WARNING: Extra .css in SCSS file is unnecessary. Rename /Users/foo/Projects/foo/app/assets/stylesheets/foo.css.scss to /Users/foo/Projects/foo/app/assets/stylesheets/foo.scss. (called from _app_views_layouts_application_html_erb__1560597815210891605_70190441246060 at /Users/foo/Projects/foo/app/views/layouts/application.html.erb:13)

有人知道这是怎么回事吗?gem是否真的希望我从以下位置重命名所有样式表资源:

app/assets/stylesheets/foo.css.scss

至:

app/assets/stylesheets/foo.scss

在我看来似乎违反了多年的Rails惯例。也许有一种方法可以抑制过时警告?

小卤蛋2020/03/24 17:14:25

这为我处理了它:

#!/bin/sh
for file in $(find ./app/assets/stylesheets/ -name "*.css.scss")
do
    git mv $file `echo $file | sed s/\.css//`
done