rename all crates

This commit is contained in:
steven-omaha
2023-02-14 13:12:08 +01:00
parent c7841ae346
commit e7cb7d9321
42 changed files with 119 additions and 93 deletions
+19
View File
@@ -0,0 +1,19 @@
use std::path::PathBuf;
use std::process::{Command, ExitStatus};
use anyhow::{anyhow, Context, Result};
use crate::env::get_editor;
pub fn run_edit_command(files: &[PathBuf]) -> Result<ExitStatus> {
let mut cmd = Command::new(get_editor().context("getting suitable editor")?);
cmd.current_dir(
files[0]
.parent()
.context("getting parent dir of first file argument")?,
);
for f in files {
cmd.arg(f.to_string_lossy().to_string());
}
cmd.status().map_err(|e| anyhow!(e))
}