mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-10-31 15:25:04 -04:00
update_source now correctly updates the archive page if it has been moved to source/archive and removes empty directories
This commit is contained in:
parent
23c876021e
commit
eb540a4404
8
Rakefile
8
Rakefile
@ -201,10 +201,10 @@ task :update_source, :theme do |t, args|
|
||||
mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
|
||||
cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir && File.exists?("#{source_dir}.old/index.html")
|
||||
if File.exists?("#{source_dir}/archives/index.html")
|
||||
cp "#{source_dir}/blog/archives/index.html", "#{source_dir}/archives/index.html", :remove_destination=>true
|
||||
rm "#{source_dir}/blog/archives/index.html", :secure=>true
|
||||
rm_r "#{source_dir}/blog/archives", :secure=>true if Dir["#{source_dir}/blog/archives"].empty?
|
||||
rm_r "#{source_dir}/blog", :secure=>true if Dir["#{source_dir}/blog"].empty?
|
||||
rm "#{source_dir}/archives/index.html"
|
||||
mv "#{source_dir}/blog/archives/index.html", "#{source_dir}/archives/index.html"
|
||||
rm_r "#{source_dir}/blog/archives"
|
||||
rm_r "#{source_dir}/blog" if Dir.entries("#{source_dir}/blog").join == "..."
|
||||
end
|
||||
puts "## Updated #{source_dir} ##"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user