... | ... |
@@ -215,6 +215,18 @@ task :copydot do |
215 | 215 |
end |
216 | 216 |
end |
217 | 217 |
|
218 |
+desc "copy dot files for Github Pages deployment" |
|
219 |
+task :copydot_deploy do |
|
220 |
+ exclusions = [".", "..", ".DS_Store"] |
|
221 |
+ Dir["#{public_dir}/**/.*"].each do |file| |
|
222 |
+ if !File.directory?(file) && !exclusions.include?(File.basename(file)) |
|
223 |
+ cp(file, file.gsub(/#{public_dir}/, "#{deploy_dir}")); |
|
224 |
+ end |
|
225 |
+ end |
|
226 |
+ puts "\n## copying #{public_dir} to #{deploy_dir}" |
|
227 |
+end |
|
228 |
+ |
|
229 |
+ |
|
218 | 230 |
desc "Deploy website via rsync" |
219 | 231 |
task :rsync do |
220 | 232 |
puts "## Deploying website via Rsync" |
... | ... |
@@ -225,8 +237,7 @@ desc "deploy public directory to github pages" |
225 | 225 |
multitask :push do |
226 | 226 |
puts "## Deploying branch to Github Pages " |
227 | 227 |
(Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) } |
228 |
- system "cp -R #{public_dir}/* #{deploy_dir}" |
|
229 |
- puts "\n## copying #{public_dir} to #{deploy_dir}" |
|
228 |
+ Rake::Task[:copydot_deploy].execute |
|
230 | 229 |
cd "#{deploy_dir}" do |
231 | 230 |
system "git add ." |
232 | 231 |
system "git add -u" |