Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Backup/restore wiki repos too

  • Loading branch information...
commit 6c206805ae445b7052d98640cb0083256d836db1 1 parent 3df5fee
@randx randx authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 lib/backup/repository.rb
View
22 lib/backup/repository.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.