From c452bbe94a0f84c1e68518bc38df7e4e1911e97d Mon Sep 17 00:00:00 2001 From: joseph Date: Sun, 17 Dec 2023 21:44:48 +0000 Subject: [PATCH] Update auth/initialize_database.rb --- auth/initialize_database.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/auth/initialize_database.rb b/auth/initialize_database.rb index 81ec7e2..6ded23b 100644 --- a/auth/initialize_database.rb +++ b/auth/initialize_database.rb @@ -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