mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-09 12:37:41 +03:00
fix: handle missing files
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define CLRSYNC_CORE_PALETTE_PALETTE_MANAGER_HPP
|
||||
|
||||
#include "core/utils.hpp"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -19,6 +20,11 @@ template <typename FileType> class palette_manager
|
||||
void load_palettes_from_directory(const std::string &directory_path)
|
||||
{
|
||||
auto directory_path_expanded = expand_user(directory_path);
|
||||
if (!std::filesystem::exists(directory_path_expanded))
|
||||
{
|
||||
std::cerr << "Palettes directory does not exist\n" ;
|
||||
return;
|
||||
}
|
||||
for (const auto &entry : std::filesystem::directory_iterator(directory_path_expanded))
|
||||
{
|
||||
if (entry.is_regular_file())
|
||||
|
||||
Reference in New Issue
Block a user