Drop zplugin support
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1845,7 +1845,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "topgrade"
|
name = "topgrade"
|
||||||
version = "4.0.1"
|
version = "4.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ categories = ["os"]
|
|||||||
keywords = ["upgrade", "update"]
|
keywords = ["upgrade", "update"]
|
||||||
license-file = "LICENSE"
|
license-file = "LICENSE"
|
||||||
repository = "https://github.com/r-darwish/topgrade"
|
repository = "https://github.com/r-darwish/topgrade"
|
||||||
version = "4.0.1"
|
version = "4.0.2"
|
||||||
authors = ["Roey Darwish Dror <roey.ghost@gmail.com>"]
|
authors = ["Roey Darwish Dror <roey.ghost@gmail.com>"]
|
||||||
exclude = ["doc/screenshot.gif"]
|
exclude = ["doc/screenshot.gif"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::error::SkipStep;
|
|
||||||
use crate::executor::RunType;
|
use crate::executor::RunType;
|
||||||
use crate::terminal::print_separator;
|
use crate::terminal::print_separator;
|
||||||
use crate::utils::{require, PathExt};
|
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 zsh = require("zsh")?;
|
||||||
let zshrc = zshrc(base_dirs).require()?;
|
let zshrc = zshrc(base_dirs).require()?;
|
||||||
|
|
||||||
let zinit_exists = env::var("ZPFX")
|
env::var("ZPFX")
|
||||||
.map(PathBuf::from)
|
.map(PathBuf::from)
|
||||||
.unwrap_or_else(|_| base_dirs.home_dir().join(".zinit"))
|
.unwrap_or_else(|_| base_dirs.home_dir().join(".zinit"))
|
||||||
.exists();
|
.require()?;
|
||||||
|
|
||||||
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());
|
|
||||||
};
|
|
||||||
|
|
||||||
print_separator("zinit");
|
print_separator("zinit");
|
||||||
|
|
||||||
let cmd = format!(
|
let cmd = format!("source {} && zinit self-update && zinit update --all", zshrc.display(),);
|
||||||
"source {} && {} self-update && {} update --all",
|
|
||||||
zshrc.display(),
|
|
||||||
zcommand,
|
|
||||||
zcommand
|
|
||||||
);
|
|
||||||
run_type.execute(zsh).args(&["-l", "-c", cmd.as_str()]).check_run()
|
run_type.execute(zsh).args(&["-l", "-c", cmd.as_str()]).check_run()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user