From 5b2b0c508bec91b3507d53544eec19c9c43ebc27 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 21 Sep 2011 18:44:21 -0500 Subject: [PATCH 1/3] fixed issue where public was being copied into _deploy --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 4a1e64e..df96f92 100644 --- a/Rakefile +++ b/Rakefile @@ -225,7 +225,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}" + system "cp -R #{public_dir}/* #{deploy_dir}" puts "\n## copying #{public_dir} to #{deploy_dir}" cd "#{deploy_dir}" do system "git add ." From a5d55fe80f4f248b3b76535e557123b3e5e5322b Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 21 Sep 2011 18:54:54 -0500 Subject: [PATCH 2/3] 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 df96f92..a792218 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" From 92ff4a9c673b2bc7555826d289a52ed67c0e8cf3 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger Date: Thu, 22 Sep 2011 10:17:31 +0200 Subject: [PATCH 3/3] copydot task can be called with parameters, no need for separate copydot_deploy --- Rakefile | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/Rakefile b/Rakefile index a792218..1b5d993 100644 --- a/Rakefile +++ b/Rakefile @@ -197,36 +197,24 @@ end desc "Default deploy task" task :deploy do - [:copydot, "#{deploy_default}"].each { |t| Rake::Task[t].execute } + Rake::Task[:copydot].invoke(source_dir, public_dir) + Rake::Task["#{deploy_default}"].execute end desc "Generate website and deploy" -task :gen_deploy do - [:integrate, :generate, :deploy].each { |t| Rake::Task[t].execute } +task :gen_deploy => [:integrate, :generate, :deploy] do end desc "copy dot files for deployment" -task :copydot do +task :copydot, :source, :dest do |t, args| exclusions = [".", "..", ".DS_Store"] - Dir["#{source_dir}/**/.*"].each do |file| + Dir["#{args.source}/**/.*"].each do |file| if !File.directory?(file) && !exclusions.include?(File.basename(file)) - cp(file, file.gsub(/#{source_dir}/, "#{public_dir}")); + cp(file, file.gsub(/#{args.source}/, "#{args.dest}")); end 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" @@ -237,7 +225,8 @@ desc "deploy public directory to github pages" multitask :push do puts "## Deploying branch to Github Pages " (Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) } - Rake::Task[:copydot_deploy].execute + Rake::Task[:copydot].invoke(public_dir, deploy_dir) + puts "\n## copying #{public_dir} to #{deploy_dir}" cd "#{deploy_dir}" do system "git add ." system "git add -u"