:-'Generic Commit'
Some checks failed
Build-Test-Publish / Build (push) Failing after 2s

This commit is contained in:
Your Name
2025-05-29 22:43:41 +12:00
parent c0489ff4d9
commit a634a12bfc
3 changed files with 25 additions and 7 deletions

View File

@@ -14,14 +14,30 @@ std::atomic<bool> g_running{true};
std::unique_ptr<Server> g_server;
std::thread g_server_thread;
std::filesystem::path get_config_path() {
std::filesystem::path system_config_path = "/data/sos_config.json";
std::filesystem::path user_config_path = std::filesystem::path(std::getenv("HOME")) / ".config/simple_object_storage/config.json";
std::filesystem::path get_executable_path() {
return std::filesystem::read_symlink("/proc/self/exe");
}
if (std::filesystem::exists(system_config_path)) return system_config_path;
if (std::filesystem::exists(user_config_path)) return user_config_path;
std::cout << "No config file found. Checked " << system_config_path << " and " << user_config_path << std::endl;
std::filesystem::path get_config_path() {
const std::filesystem::path _home = std::getenv("HOME");
const std::filesystem::path _exe = get_executable_path().parent_path();
// check for config in the following paths:
std::vector<std::filesystem::path> config_paths = {
"/data/sos_config.json",
_home / ".config/simple_object_storage/config.json",
_exe / ".." / ".test-docker" / "config.json"
};
for (const auto& path : config_paths) {
if (std::filesystem::exists(path)) {
return path;
}
}
std::cout << "No config file found. Checked: " << std::endl;
for (const auto& path : config_paths) {
std::cout << " " << path << std::endl;
}
return std::filesystem::path();
}

1
test.sh.downloaded1 Normal file
View File

@@ -0,0 +1 @@
{"error":"Couldn't find: null","result":"error"}

1
test.sh.downloaded2 Normal file
View File

@@ -0,0 +1 @@
{"error":"Couldn't find: autotest:test1","result":"error"}