Add support for the micro text editor (#635)
This commit is contained in:
@@ -11,6 +11,7 @@ use anyhow::Result;
|
||||
use directories::BaseDirs;
|
||||
use log::debug;
|
||||
use std::env;
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
use tempfile::tempfile_in;
|
||||
@@ -101,6 +102,21 @@ pub fn run_vscode(run_type: RunType) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn run_micro(run_type: RunType) -> Result<()> {
|
||||
let micro = utils::require("micro")?;
|
||||
|
||||
print_separator("micro");
|
||||
|
||||
let stdout = run_type.execute(µ).args(&["-plugin", "update"]).string_output()?;
|
||||
std::io::stdout().write_all(&stdout.as_bytes())?;
|
||||
|
||||
if stdout.contains("Nothing to install / update") || stdout.contains("One or more plugins installed") {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(anyhow::anyhow!("micro output does not indicate success: {}", stdout))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(
|
||||
target_os = "freebsd",
|
||||
target_os = "openbsd",
|
||||
|
||||
Reference in New Issue
Block a user