Update auth/initialize_database.rb

This commit is contained in:
joseph 2023-12-17 21:44:48 +00:00
parent 61bc30a679
commit c452bbe94a
1 changed files with 9 additions and 3 deletions

View File

@ -8,17 +8,23 @@ def initialize_database
database_path = DATA_LOCATION + DATABASE_SUBPATH
file_path = DATA_LOCATION + FILE_STORAGE_LOCATION
unless File.directory?(DATA_LOCATION)
puts "Checking if directory '#{DATA_LOCATION}' exists."
unless Dir.exist(DATA_LOCATION)
puts "Directory '#{DATA_LOCATION}' does not exist."
Dir.mkdir(DATA_LOCATION)
puts "Directory '#{DATA_LOCATION}' created successfully."
end
unless File.directory?(database_path)
puts "Checking if directory '#{database_path}' exists."
unless Dir.exist(database_path)
puts "Directory '#{database_path}' does not exist."
Dir.mkdir(database_path)
puts "Directory '#{database_path}' created successfully."
end
unless File.directory?(file_path)
puts "Checking if directory '#{file_path}' exists."
unless Dir.exist(file_path)
puts "Directory '#{file_path}' does not exist."
Dir.mkdir(file_path)
puts "Directory '#{file_path}' created successfully."
end