-
-
Save terry90/4845ab17202dc3b8bc8f39884c972dc8 to your computer and use it in GitHub Desktop.
medium_answer_build_scss
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
def compile_scss(compress = true) | |
puts cyan 'Compiling Sass files...' | |
files = Dir[File.join(__dir__, 'src/**/*.scss')].reject { |name| name.split("/").last[0] == '_'} | |
system(": > ./static/app.css") | |
files.each do |file| | |
compress ? | |
system("sass #{file} -s compressed | uglifycss >> ./static/app.css") : | |
system("sass #{file} >> ./static/app.css") | |
end | |
puts green 'Sass files compiled' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment