From a5d55fe80f4f248b3b76535e557123b3e5e5322b Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 21 Sep 2011 18:54:54 -0500 Subject: Fixed issue where dotfiles were not being copied to _deploy for github pages deployments --- Rakefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index df96f92b..a7922189 100644 --- a/Rakefile +++ b/Rakefile @@ -215,6 +215,18 @@ task :copydot do end end +desc "copy dot files for Github Pages deployment" +task :copydot_deploy do + exclusions = [".", "..", ".DS_Store"] + Dir["#{public_dir}/**/.*"].each do |file| + if !File.directory?(file) && !exclusions.include?(File.basename(file)) + cp(file, file.gsub(/#{public_dir}/, "#{deploy_dir}")); + end + end + puts "\n## copying #{public_dir} to #{deploy_dir}" +end + + desc "Deploy website via rsync" task :rsync do puts "## Deploying website via Rsync" @@ -225,8 +237,7 @@ desc "deploy public directory to github pages" multitask :push do puts "## Deploying branch to Github Pages " (Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) } - system "cp -R #{public_dir}/* #{deploy_dir}" - puts "\n## copying #{public_dir} to #{deploy_dir}" + Rake::Task[:copydot_deploy].execute cd "#{deploy_dir}" do system "git add ." system "git add -u" -- cgit v1.2.1