Made offline extraction more verbose

This commit is contained in:
g0tmi1k
2018-05-14 13:37:34 +01:00
parent de960ff9db
commit 0e05f77fb7

View File

@@ -102,8 +102,18 @@ end
def extract_db_zip
Zip::File.open(DATA_FILE) do |zip_file|
zip_file.each do |f|
# Feedback to the user
puts "[+] Extracting: #{File.basename(f.name)}" if verbose
f_path = File.join(DATA_DIR, File.basename(f.name))
# Create folder
FileUtils.mkdir_p(File.dirname(f_path))
# Delete if already there
puts "[+] Deleting: #{File.basename(f.name)}" if verbose and File.exist?(f_path)
FileUtils.rm(f_path) if File.exist?(f_path)
# Extract
zip_file.extract(f, f_path)
end
end