Skip rather than fail empty wikis during backup

This commit is contained in:
Jacob Vosmaer 2013-10-09 17:17:04 +02:00
parent 461abaa843
commit cb6a86ed62
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@ module Backup
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")
if wiki.empty?
puts " [SKIPPED]".cyan
elsif 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