diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2014-03-20 07:13:26 +0400 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2014-03-20 07:13:26 +0400 |
commit | 1cfa55e8ad505e8f41a8d65512d6971eb515771a (patch) | |
tree | f0392c6689f5ae227d11004679aecea7129c9514 | |
parent | 5db7be8e096b259c4f517d23ece1100384b79a70 (diff) | |
parent | c624370acb30b071054db4ebc277225479736aab (diff) |
Merge pull request #565 from carlosdp/create-css-path-dir
Create directory from argument in compile task
-rw-r--r-- | Rakefile | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -37,13 +37,14 @@ task :compile, :css_path do |t, args| require 'term/ansicolor' path = 'vendor/assets/stylesheets' + css_path = args.with_defaults(css_path: 'tmp')[:css_path] puts Term::ANSIColor.bold "Compiling SCSS in #{path}" + Dir.mkdir(css_path) unless File.directory?(css_path) %w(bootstrap bootstrap/_theme).each do |file| - save_path = "#{args.with_defaults(css_path: 'tmp')[:css_path]}/#{file.sub(/(^|\/)?_+/, '\1').sub('/', '-')}.css" + save_path = "#{css_path}/#{file.sub(/(^|\/)?_+/, '\1').sub('/', '-')}.css" puts Term::ANSIColor.cyan(" #{save_path}") + '...' engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path]) css = engine.render - Dir.mkdir('tmp') unless File.directory?('tmp') File.open(save_path, 'w') { |f| f.write css } end end |