Skip to content

Instantly share code, notes, and snippets.

@SteveBenner
Created March 23, 2014 01:51
Show Gist options
  • Save SteveBenner/9717384 to your computer and use it in GitHub Desktop.
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
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