Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of https://github.com/DylanLacey/bourbon

  • Loading branch information...
commit 56d3e4c1cb5a785cfd6c60d088733931e9760a54 2 parents a85ce35 + 281ed16
@mike-burns mike-burns authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 lib/tasks/install.rake
View
15 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
Please sign in to comment.
Something went wrong with that request. Please try again.