This commit is contained in:
Your Name
2025-05-04 19:56:52 +12:00
parent 27e5cce367
commit 008cf59c48
7 changed files with 98 additions and 20 deletions

View File

@ -134,6 +134,9 @@ int main(int argc, char* argv[]) {
}
if (cmd == "edit" && argc < 3) {
if (!gConfig().is_config_set())
gConfig().save_config(false);
std::string config_file = localfile::dropshell_json();
if (!edit_file(config_file) || !std::filesystem::exists(config_file))
return die("Error: Failed to edit config file.");
@ -142,9 +145,8 @@ int main(int argc, char* argv[]) {
if (!gConfig().is_config_set())
return die("Error: Failed to load and parse edited config file.");
gConfig().save_config();
gConfig().load_config();
std::cout << "Successfully edited config file." << std::endl;
gConfig().save_config(true);
std::cout << "Successfully edited config file at " << config_file << std::endl;
return 0;
}