.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user