Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DylanLacey/bourbon
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-burns committed Mar 16, 2012
2 parents a85ce35 + 281ed16 commit 56d3e4c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/tasks/install.rake
@@ -1,11 +1,20 @@
# Needed for pre-3.1.

require "fileutils"
require "find"

namespace :bourbon do
desc "Move files to the Rails assets directory."
task :install, [:sass_path] do |t, args|
args.with_defaults :sass_path => 'public/stylesheets/sass'
source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
`mkdir -p #{Rails.root}/#{args.sass_path}/bourbon`
`cp -a #{source_root}/app/assets/stylesheets/* #{Rails.root}/#{args.sass_path}/bourbon`
`find #{Rails.root}/#{args.sass_path}/bourbon -name "*.css.scss" | while read i; do mv "$i" "${i%.css.scss}.scss"; done`
FileUtils.mkdir_p "#{Rails.root}/#{args.sass_path}/bourbon"
FileUtils.cp_r "#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/bourbon", {:preserve => true}
Find.find("#{Rails.root}/#{args.sass_path}/bourbon") do |path|
if path.end_with?(".css.scss")
path_without_css_extention = path.gsub(".css.scss", "")<<".scss"
FileUtils.mv(path, path_without_css_extention)
end
end
end
end

0 comments on commit 56d3e4c

Please sign in to comment.