Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-sass.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2014-03-20 07:13:26 +0400
committerGleb Mazovetskiy <glex.spb@gmail.com>2014-03-20 07:13:26 +0400
commit1cfa55e8ad505e8f41a8d65512d6971eb515771a (patch)
treef0392c6689f5ae227d11004679aecea7129c9514
parent5db7be8e096b259c4f517d23ece1100384b79a70 (diff)
parentc624370acb30b071054db4ebc277225479736aab (diff)
Merge pull request #565 from carlosdp/create-css-path-dir
Create directory from argument in compile task
-rw-r--r--Rakefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Rakefile b/Rakefile
index 4bc3114b..5468a685 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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