Removes system specific File IO from Rakefile, rather we make use of FileUtils.

This commit is contained in:
Benjamin R Doerr 2011-08-22 22:46:04 -04:00
parent 9d57455e0f
commit 5f08abe6dd

View File

@ -124,7 +124,7 @@ end
desc "Clean out caches: _code_cache, _gist_cache, .sass-cache" desc "Clean out caches: _code_cache, _gist_cache, .sass-cache"
task :clean do task :clean do
system "rm -rf _code_cache/** _gist_cache/** .sass-cache/** source/stylesheets/screen.css" rm_rf ["_code_cache/**", "_gist_cache/**", ".sass-cache/**", "source/stylesheets/screen.css"]
end end
desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom" desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
@ -132,12 +132,12 @@ task :update_style, :theme do |t, args|
theme = args.theme || 'classic' theme = args.theme || 'classic'
if File.directory?("sass.old") if File.directory?("sass.old")
puts "removed existing sass.old directory" puts "removed existing sass.old directory"
system "rm -r sass.old" rm_r "sass.old", :secure=>true
end end
system "mv sass sass.old" mv "sass", "sass.old"
puts "## Moved styles into sass.old/" puts "## Moved styles into sass.old/"
system "mkdir -p sass" mkdir_p "sass"
system "cp -R #{themes_dir}/"+theme+"/sass/ sass/" cp_r "#{themes_dir}/"+theme+"/sass/", "sass"
cp_r "sass.old/custom/.", "sass/custom" cp_r "sass.old/custom/.", "sass/custom"
puts "## Updated Sass ##" puts "## Updated Sass ##"
end end
@ -147,16 +147,16 @@ task :update_source, :theme do |t, args|
theme = args.theme || 'classic' theme = args.theme || 'classic'
if File.directory?("#{source_dir}.old") if File.directory?("#{source_dir}.old")
puts "removed existing #{source_dir}.old directory" puts "removed existing #{source_dir}.old directory"
system "rm -r #{source_dir}.old" rm_r "#{source_dir}.old", :secure=>true
end end
system "mv #{source_dir} #{source_dir}.old" mv source_dir, "#{source_dir}.old"
puts "moved #{source_dir} into #{source_dir}.old/" puts "moved #{source_dir} into #{source_dir}.old/"
system "mkdir -p #{source_dir}" mkdir_p source_dir
system "cp -R #{themes_dir}/"+theme+"/source/. #{source_dir}" cp_r "#{themes_dir}/"+theme+"/source/.", source_dir
system "cp -Rn #{source_dir}.old/. #{source_dir}" cp_r "#{source_dir}.old/.", source_dir, :preserve=>true
system "cp -Rf #{source_dir}.old/_includes/custom/. #{source_dir}/_includes/custom/" cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/"
system "mv -f #{source_dir}/index.html #{blog_index_dir}" if blog_index_dir != source_dir mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
system "cp -f #{source_dir}.old/index.html #{source_dir}" if blog_index_dir != source_dir cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir
puts "## Updated #{source_dir} ##" puts "## Updated #{source_dir} ##"
end end