diff options
author | Kevin Song <chips@ksong.dev> | 2022-05-02 11:43:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 18:43:27 +0200 |
commit | 2e80aec5cb6f7376359e7a25a76a492a98717554 (patch) | |
tree | 0180dc508a503cc508e489daff507efab607aa41 /src/main.rs | |
parent | f81fcfe6f8e33b814a1f0eed97e67288bcdc9231 (diff) |
fix: Do not panic in config if editor not found (#3766)
* fix: Do not panic in config if editor not found
* Add tests for edit_configuration
Adds tests for no-panic condition on editor by adding an override to
edit_configuration.
* Sorry clippy :(
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 1afb2859e..fba5a094f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -187,8 +187,9 @@ fn main() { if let Some(value) = value { configure::update_configuration(&name, &value) } - } else { - configure::edit_configuration() + } else if let Err(reason) = configure::edit_configuration(None) { + eprintln!("Could not edit configuration: {}", reason); + std::process::exit(1); } } Commands::PrintConfig { default, name } => configure::print_configuration(default, &name), |