Permalink
Browse files

Backup/restore wiki repos too

  • Loading branch information...
1 parent 3df5fee commit 6c206805ae445b7052d98640cb0083256d836db1 @dzaporozhets dzaporozhets committed Apr 5, 2013
Showing with 22 additions and 0 deletions.
  1. +22 −0 lib/backup/repository.rb
View
@@ -23,6 +23,17 @@ def dump
else
puts "[FAILED]".red
end
+
+ wiki = GollumWiki.new(project)
+
+ if File.exists?(path_to_repo(wiki))
+ print " * #{wiki.path_with_namespace} ... "
+ if system("cd #{path_to_repo(wiki)} > /dev/null 2>&1 && git bundle create #{path_to_bundle(wiki)} --all > /dev/null 2>&1")
+ puts " [DONE]".green
+ else
+ puts " [FAILED]".red
+ end
+ end
end
end
@@ -45,6 +56,17 @@ def restore
else
puts "[FAILED]".red
end
+
+ wiki = GollumWiki.new(project)
+
+ if File.exists?(path_to_bundle(wiki))
+ print " * #{wiki.path_with_namespace} ... "
+ if system("git clone --bare #{path_to_bundle(wiki)} #{path_to_repo(wiki)} > /dev/null 2>&1")
+ puts " [DONE]".green
+ else
+ puts " [FAILED]".red
+ end
+ end
end
end

0 comments on commit 6c20680

Please sign in to comment.