This commit is contained in:
@ -62,7 +62,7 @@ namespace localpath {
|
||||
|
||||
std::string remote_versions(const std::string &server_name, const std::string &service_name)
|
||||
{
|
||||
std::string template_cache_path = gConfig().get_local_template_cache_path();
|
||||
std::string template_cache_path = localpath::template_cache();
|
||||
return ((template_cache_path.empty() || service_name.empty()) ? "" :
|
||||
(template_cache_path+"/remote_versions/"+service_name+".json"));
|
||||
}
|
||||
@ -84,6 +84,48 @@ namespace localpath {
|
||||
warning << "Couldn't determine user directory" << std::endl;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string dropshell_files()
|
||||
{
|
||||
return current_user_home() + "/.local/dropshell_files";
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string backups()
|
||||
{
|
||||
return dropshell_files() + "/backups";
|
||||
}
|
||||
|
||||
std::string temp_files()
|
||||
{
|
||||
return dropshell_files() + "/temp_files";
|
||||
}
|
||||
|
||||
std::string template_cache()
|
||||
{
|
||||
return dropshell_files() + "template_cache";
|
||||
}
|
||||
|
||||
bool create_directories()
|
||||
{
|
||||
std::vector<std::filesystem::path> paths = {
|
||||
dropshell_files(),
|
||||
template_cache(),
|
||||
backups(),
|
||||
temp_files(),
|
||||
agent()};
|
||||
for (auto &p : gConfig().get_local_server_definition_paths())
|
||||
paths.push_back(p);
|
||||
|
||||
for (auto &p : paths)
|
||||
if (!std::filesystem::exists(p))
|
||||
{
|
||||
info << "Creating directory: " << p << std::endl;
|
||||
std::filesystem::create_directories(p);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace localpath
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user