Add support for the micro text editor (#635)
This commit is contained in:
@@ -86,6 +86,7 @@ pub enum Step {
|
||||
Jetpack,
|
||||
Krew,
|
||||
MacPorts,
|
||||
Micro,
|
||||
MicrosoftAutoUpdate,
|
||||
Myrepos,
|
||||
Nix,
|
||||
|
||||
@@ -309,6 +309,7 @@ fn run() -> Result<()> {
|
||||
runner.execute(Step::Gcloud, "gcloud", || {
|
||||
generic::run_gcloud_components_update(run_type)
|
||||
})?;
|
||||
runner.execute(Step::Micro, "micro", || generic::run_micro(run_type))?;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
|
||||
@@ -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