Browse code

fixed issue where update_source failed if source/index was any extension other than .html

Brandon Mathis authored on 02/10/2011 at 04:36:52
Showing 1 changed files
... ...
@@ -184,13 +184,14 @@ task :update_source, :theme do |t, args|
184 184
     puts "## Removed existing #{source_dir}.old directory"
185 185
     rm_r "#{source_dir}.old", :secure=>true
186 186
   end
187
+  mkdir "#{source_dir}.old"
187 188
   cp_r "#{source_dir}/.", "#{source_dir}.old"
188 189
   puts "## Copied #{source_dir} into #{source_dir}.old/"
189 190
   cp_r "#{themes_dir}/"+theme+"/source/.", source_dir, :remove_destination=>true
190 191
   cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true
191 192
   cp "#{source_dir}.old/favicon.png", source_dir
192 193
   mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
193
-  cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir
194
+  cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir && File.exists?("#{source_dir}.old/index.html")
194 195
   puts "## Updated #{source_dir} ##"
195 196
 end
196 197