Drop zplugin support

This commit is contained in:
Roey Darwish Dror
2020-02-20 17:29:11 +02:00
parent 3416522525
commit 9f103462ba
3 changed files with 5 additions and 25 deletions

2
Cargo.lock generated
View File

@@ -1845,7 +1845,7 @@ dependencies = [
[[package]]
name = "topgrade"
version = "4.0.1"
version = "4.0.2"
dependencies = [
"anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@@ -5,7 +5,7 @@ categories = ["os"]
keywords = ["upgrade", "update"]
license-file = "LICENSE"
repository = "https://github.com/r-darwish/topgrade"
version = "4.0.1"
version = "4.0.2"
authors = ["Roey Darwish Dror <roey.ghost@gmail.com>"]
exclude = ["doc/screenshot.gif"]
edition = "2018"

View File

@@ -1,4 +1,3 @@
use crate::error::SkipStep;
use crate::executor::RunType;
use crate::terminal::print_separator;
use crate::utils::{require, PathExt};
@@ -69,33 +68,14 @@ pub fn run_zinit(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> {
let zsh = require("zsh")?;
let zshrc = zshrc(base_dirs).require()?;
let zinit_exists = env::var("ZPFX")
env::var("ZPFX")
.map(PathBuf::from)
.unwrap_or_else(|_| base_dirs.home_dir().join(".zinit"))
.exists();
let zplugin_exists = env::var("ZPLUG_HOME")
.map(PathBuf::from)
.unwrap_or_else(|_| base_dirs.home_dir().join(".zplugin"))
.exists();
// Check whether this is a pre- or post- renaming installation
let zcommand = if zinit_exists {
"zinit"
} else if zplugin_exists {
"zplugin"
} else {
return Err(SkipStep.into());
};
.require()?;
print_separator("zinit");
let cmd = format!(
"source {} && {} self-update && {} update --all",
zshrc.display(),
zcommand,
zcommand
);
let cmd = format!("source {} && zinit self-update && zinit update --all", zshrc.display(),);
run_type.execute(zsh).args(&["-l", "-c", cmd.as_str()]).check_run()
}