Permalink
Browse files

Changed install task to be pure ruby, allowing it to run on systems (…

…Windows) without POSIX compliant shells
  • Loading branch information...
1 parent 10a5908 commit e4ed1b3234c87110c05a2b94510f781d9d3b6ec9 Dylan Lacey committed Mar 13, 2012
Showing with 10 additions and 4 deletions.
  1. +10 −4 lib/tasks/install.rake
View
@@ -1,11 +1,17 @@
# 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|
+ FileUtils.mv(path path.gsub(".css.scss", "")<<".scss") if File.basename(path).end_with?(".css.scss")
+ end
end
-end
+end

0 comments on commit e4ed1b3

Please sign in to comment.