refactor get_assumed_group_file_names
is now called get_group_file_paths_matching_args
This commit is contained in:
@@ -5,19 +5,15 @@ use anyhow::{anyhow, Context, Result};
|
||||
|
||||
use crate::env::get_editor;
|
||||
|
||||
pub fn run_edit_command<P>(files: &[P]) -> Result<ExitStatus>
|
||||
where
|
||||
P: for<'a> AsRef<&'a Path>,
|
||||
{
|
||||
pub fn run_edit_command(files: &[&Path]) -> Result<ExitStatus> {
|
||||
let mut cmd = Command::new(get_editor().context("getting suitable editor")?);
|
||||
cmd.current_dir(
|
||||
files[0]
|
||||
.as_ref()
|
||||
.parent()
|
||||
.context("getting parent dir of first file argument")?,
|
||||
);
|
||||
for f in files {
|
||||
cmd.arg(f.as_ref().to_string_lossy().to_string());
|
||||
cmd.arg(f.to_string_lossy().to_string());
|
||||
}
|
||||
cmd.status().map_err(|e| anyhow!(e))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user