mirror of
https://git.meli.delivery/meli/meli
synced 2024-11-09 01:10:33 +00:00
59c99fdc79
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
24 lines
797 B
Diff
24 lines
797 B
Diff
From: Manos Pitsidianakis <manos@pitsidianak.is>
|
|
Date: Thu, 27 Feb 2014 16:06:15 +0100
|
|
Subject: usr_bin_editor
|
|
|
|
If EDITOR or VISUAL is not set, fall back to /usr/bin/editor,
|
|
which is set by update-alternatives.
|
|
---
|
|
meli/src/subcommands.rs | 1 +---
|
|
1 file changed, 1 insertion(+), 3 deletions(-)
|
|
|
|
--- a/meli/src/subcommands.rs
|
|
+++ b/meli/src/subcommands.rs
|
|
@@ -52,9 +52,7 @@
|
|
pub fn edit_config() -> Result<()> {
|
|
let editor = std::env::var("EDITOR")
|
|
.or_else(|_| std::env::var("VISUAL"))
|
|
- .map_err(|err| {
|
|
- format!("Could not find any value in environment variables EDITOR and VISUAL. {err}")
|
|
- })?;
|
|
+ .unwrap_or_else(|_| "/usr/bin/editor".into());
|
|
let config_path = crate::conf::get_config_file()?;
|
|
|
|
let mut cmd = Command::new(editor);
|