Skip to content

Commit

Permalink
Backup/restore wiki repos too
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Apr 5, 2013
1 parent 3df5fee commit 6c20680
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/backup/repository.rb
Expand Up @@ -23,6 +23,17 @@ def dump
else else
puts "[FAILED]".red puts "[FAILED]".red
end 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
end end


Expand All @@ -45,6 +56,17 @@ def restore
else else
puts "[FAILED]".red puts "[FAILED]".red
end 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
end end


Expand Down

0 comments on commit 6c20680

Please sign in to comment.