This commit is contained in:
@@ -37,7 +37,7 @@ bool config::load_config() { // load json config file.
|
||||
}
|
||||
catch (nlohmann::json::parse_error& ex)
|
||||
{
|
||||
std::cerr << "Error: Failed to parse config file: " << ex.what() << std::endl;
|
||||
error << "Failed to parse config file: " << ex.what() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ bool config::save_config(bool create_aux_directories)
|
||||
if (!mIsConfigSet)
|
||||
{
|
||||
std::string homedir = localpath::current_user_home();
|
||||
std::string dropshell_base = homedir + "/.local/dropshell_files";
|
||||
std::string dropshell_base = homedir + "/.dropshell";
|
||||
|
||||
mConfig["server_definition_paths"] = {
|
||||
dropshell_base + "/servers"
|
||||
@@ -81,6 +81,10 @@ bool config::save_config(bool create_aux_directories)
|
||||
"https://templates.dropshell.app"
|
||||
};
|
||||
mConfig["template_upload_token"] = "SECRETTOKEN";
|
||||
|
||||
mConfig["backups_path"] = {
|
||||
dropshell_base + "/backups"
|
||||
};
|
||||
}
|
||||
|
||||
config_file << mConfig.dump(4);
|
||||
@@ -175,4 +179,10 @@ std::string config::get_template_upload_token() {
|
||||
return mConfig["template_upload_token"];
|
||||
}
|
||||
|
||||
std::string config::get_backups_path()
|
||||
{
|
||||
return mConfig["backups_path"];
|
||||
}
|
||||
|
||||
|
||||
} // namespace dropshell
|
Reference in New Issue
Block a user