Browse code

added support for deploying "dot" files (eg. .htaccess), fixes #104

Brandon Mathis authored on 21/08/2011 at 22:38:10
Showing 1 changed files
... ...
@@ -163,7 +163,19 @@ end
163 163
 ##############
164 164
 
165 165
 desc "Default deploy task"
166
-task :deploy => "#{deploy_default}" do
166
+multitask :deploy => [:copydot, "#{deploy_default}"] do
167
+end
168
+
169
+desc "copy dot files for deployment"
170
+task :copydot do
171
+  cd "#{source_dir}" do
172
+    exclusions = [".", "..", ".DS_Store"]
173
+    Dir[".*"].each do |file|
174
+      if !File.directory?(file) && !exclusions.include?(file)
175
+        cp(file, "../#{public_dir}");
176
+      end
177
+    end
178
+  end
167 179
 end
168 180
 
169 181
 desc "Deploy website via rsync"
... ...
@@ -173,7 +185,7 @@ task :rsync do
173 173
 end
174 174
 
175 175
 desc "deploy public directory to github pages"
176
-task :push do
176
+multitask :push do
177 177
   puts "## Deploying branch to Github Pages "
178 178
   (Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) }
179 179
   system "cp -R #{public_dir}/* #{deploy_dir}"