Created
March 23, 2014 01:51
-
-
Save SteveBenner/9717384 to your computer and use it in GitHub Desktop.
Recursively convert a directory of SASS files from one syntax to the alternate one
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIR = '<project-root>' | |
files = Dir.glob("#{DIR}/**/*.scss") | |
files.each { |f| `sass-convert #{f} #{f.sub(/\.scss/, '.sass')}` unless File.exist?(f.sub(/\.scss/, '.sass')) } | |
# one-liner for CLI use | |
# ruby -e "Dir.glob('<project-root>/**/*.scss').each { |f| `sass-convert #{f} #{f.sub(/\.scss/, '.sass')}` unless File.exist?(f.sub(/\.scss/, '.sass')) }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment