mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-09 04:29:04 +03:00
chore: structured src/gui, run clang-format
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "utils.hpp"
|
||||
#include <iostream>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
namespace clrsync::core
|
||||
{
|
||||
@@ -14,10 +14,10 @@ void print_color_keys()
|
||||
|
||||
std::string get_default_config_path()
|
||||
{
|
||||
const char* env_path = std::getenv("CLRSYNC_CONFIG_PATH");
|
||||
const char *env_path = std::getenv("CLRSYNC_CONFIG_PATH");
|
||||
if (env_path && env_path[0] != '\0')
|
||||
return normalize_path(env_path).string();
|
||||
|
||||
|
||||
std::filesystem::path home = normalize_path("~");
|
||||
std::filesystem::path config_path = home / ".config" / "clrsync" / "config.toml";
|
||||
return config_path.string();
|
||||
@@ -27,7 +27,7 @@ std::string expand_user(const std::string &path)
|
||||
{
|
||||
if (path.empty() || path[0] != '~')
|
||||
return path;
|
||||
|
||||
|
||||
if (path.length() == 1 || path[1] == '/' || path[1] == '\\')
|
||||
{
|
||||
#ifdef _WIN32
|
||||
@@ -37,10 +37,10 @@ std::string expand_user(const std::string &path)
|
||||
#endif
|
||||
if (!home)
|
||||
return path;
|
||||
|
||||
|
||||
if (path.length() == 1)
|
||||
return std::string(home);
|
||||
|
||||
|
||||
return std::string(home) + path.substr(1);
|
||||
}
|
||||
return path;
|
||||
|
||||
Reference in New Issue
Block a user