mirror of https://git.meli.delivery/meli/meli
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
797 B
Diff
24 lines
797 B
Diff
10 months ago
|
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);
|