.
This commit is contained in:
@ -78,11 +78,17 @@ void init_user_directory(const std::string& path) {
|
||||
// Convert to absolute path
|
||||
fs::path abs_path = fs::absolute(path);
|
||||
|
||||
// Create directory if it doesn't exist
|
||||
// The directory must exist
|
||||
if (!fs::exists(abs_path)) {
|
||||
throw std::runtime_error("The user directory does not exist: " + abs_path.string());
|
||||
}
|
||||
|
||||
// create the servers subdirectory if it doesn't exist
|
||||
fs::path servers_dir = abs_path / "servers";
|
||||
if (!fs::exists(servers_dir)) {
|
||||
fs::create_directories(servers_dir);
|
||||
}
|
||||
|
||||
// Update config file
|
||||
std::string config_path;
|
||||
if (!get_config_path(config_path)) {
|
||||
|
Reference in New Issue
Block a user