refactor data directory
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
parent
9f90494efb
commit
86918595b3
@ -46,6 +46,8 @@ public:
|
||||
[[nodiscard]] static auto default_rpc_port(const provider_type &prov)
|
||||
-> std::uint16_t;
|
||||
|
||||
[[nodiscard]] static auto get_data_directory() -> std::string;
|
||||
|
||||
[[nodiscard]] static auto get_provider_display_name(const provider_type &prov)
|
||||
-> std::string;
|
||||
|
||||
|
@ -699,36 +699,38 @@ auto app_config::default_api_port(const provider_type &prov) -> std::uint16_t {
|
||||
return PROVIDER_API_PORTS.at(static_cast<std::size_t>(prov));
|
||||
}
|
||||
|
||||
auto app_config::default_data_directory(const provider_type &prov)
|
||||
-> std::string {
|
||||
auto app_config::get_data_directory() -> std::string {
|
||||
#if defined(_WIN32)
|
||||
auto data_directory =
|
||||
utils::path::combine(utils::get_local_app_data_directory(),
|
||||
{
|
||||
REPERTORY_DATA_NAME,
|
||||
app_config::get_provider_name(prov),
|
||||
});
|
||||
auto data_directory = utils::path::combine(
|
||||
utils::get_local_app_data_directory(), {
|
||||
REPERTORY_DATA_NAME,
|
||||
});
|
||||
#else // !defined(_WIN32)
|
||||
#if defined(__APPLE__)
|
||||
auto data_directory =
|
||||
utils::path::combine("~", {
|
||||
"Library",
|
||||
"Application Support",
|
||||
REPERTORY_DATA_NAME,
|
||||
app_config::get_provider_name(prov),
|
||||
});
|
||||
auto data_directory = utils::path::combine("~", {
|
||||
"Library",
|
||||
"Application Support",
|
||||
REPERTORY_DATA_NAME,
|
||||
});
|
||||
#else // !defined(__APPLE__)
|
||||
auto data_directory =
|
||||
utils::path::combine("~", {
|
||||
".local",
|
||||
REPERTORY_DATA_NAME,
|
||||
app_config::get_provider_name(prov),
|
||||
});
|
||||
auto data_directory = utils::path::combine("~", {
|
||||
".local",
|
||||
REPERTORY_DATA_NAME,
|
||||
});
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // defined(_WIN32)
|
||||
return data_directory;
|
||||
}
|
||||
|
||||
auto app_config::default_data_directory(const provider_type &prov)
|
||||
-> std::string {
|
||||
return utils::path::combine(app_config::get_data_directory(),
|
||||
{
|
||||
REPERTORY_DATA_NAME,
|
||||
app_config::get_provider_name(prov),
|
||||
});
|
||||
}
|
||||
|
||||
auto app_config::default_remote_api_port(const provider_type &prov)
|
||||
-> std::uint16_t {
|
||||
static const std::array<std::uint16_t,
|
||||
|
@ -55,7 +55,7 @@ private:
|
||||
httplib::Server *server_;
|
||||
|
||||
private:
|
||||
console_consumer console{};
|
||||
console_consumer console;
|
||||
};
|
||||
} // namespace repertory::ui
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user