10.2.0 release (#213)

This commit is contained in:
Thomas Schönauer
2022-11-23 15:18:09 +00:00
committed by GitHub
parent 6f48017761
commit 13076fcef6
43 changed files with 1576 additions and 884 deletions

View File

@@ -1,19 +1,20 @@
use crate::command::CommandExt;
use crate::error::{SkipStep, TopgradeError};
use anyhow::Result;
use color_eyre::eyre::Result;
use crate::executor::{CommandExt, Executor, ExecutorOutput, RunType};
use crate::executor::{Executor, ExecutorOutput, RunType};
use crate::terminal::print_separator;
use crate::{
execution_context::ExecutionContext,
utils::{require, PathExt},
};
use directories::BaseDirs;
use log::debug;
use std::path::PathBuf;
use std::{
io::{self, Write},
process::Command,
};
use tracing::debug;
const UPGRADE_VIM: &str = include_str!("upgrade.vim");
@@ -63,7 +64,7 @@ fn upgrade(command: &mut Executor, ctx: &ExecutionContext) -> Result<()> {
}
if !status.success() {
return Err(TopgradeError::ProcessFailed(status).into());
return Err(TopgradeError::ProcessFailed(command.get_program(), status).into());
} else {
println!("Plugins upgraded")
}
@@ -84,22 +85,22 @@ pub fn upgrade_ultimate_vimrc(ctx: &ExecutionContext) -> Result<()> {
.execute(&git)
.current_dir(&config_dir)
.args(["reset", "--hard"])
.check_run()?;
.status_checked()?;
ctx.run_type()
.execute(&git)
.current_dir(&config_dir)
.args(["clean", "-d", "--force"])
.check_run()?;
.status_checked()?;
ctx.run_type()
.execute(&git)
.current_dir(&config_dir)
.args(["pull", "--rebase"])
.check_run()?;
.status_checked()?;
ctx.run_type()
.execute(python)
.current_dir(config_dir)
.arg(update_plugins)
.check_run()?;
.status_checked()?;
Ok(())
}
@@ -107,8 +108,8 @@ pub fn upgrade_ultimate_vimrc(ctx: &ExecutionContext) -> Result<()> {
pub fn upgrade_vim(base_dirs: &BaseDirs, ctx: &ExecutionContext) -> Result<()> {
let vim = require("vim")?;
let output = Command::new(&vim).arg("--version").check_output()?;
if !output.starts_with("VIM") {
let output = Command::new(&vim).arg("--version").output_checked_utf8()?;
if !output.stdout.starts_with("VIM") {
return Err(SkipStep(String::from("vim binary might be actually nvim")).into());
}
@@ -147,5 +148,5 @@ pub fn run_voom(_base_dirs: &BaseDirs, run_type: RunType) -> Result<()> {
print_separator("voom");
run_type.execute(voom).arg("update").check_run()
run_type.execute(voom).arg("update").status_checked()
}