Add zplugin to zsh steps (#265)

This commit is contained in:
Kyle Copperfield
2019-12-01 06:40:23 +00:00
committed by Roey Darwish Dror
parent 68a9c1c7cb
commit ccc09a6ee9
2 changed files with 24 additions and 0 deletions

View File

@@ -314,6 +314,12 @@ fn run() -> Result<(), Error> {
|| zsh::run_zplug(&base_dirs, run_type), || zsh::run_zplug(&base_dirs, run_type),
config.no_retry(), config.no_retry(),
)?; )?;
execute(
&mut report,
"zplugin",
|| zsh::run_zplugin(&base_dirs, run_type),
config.no_retry(),
)?;
execute( execute(
&mut report, &mut report,
"oh-my-zsh", "oh-my-zsh",

View File

@@ -55,6 +55,24 @@ pub fn run_zplug(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error> {
run_type.execute(zsh).args(&["-c", cmd.as_str()]).check_run() run_type.execute(zsh).args(&["-c", cmd.as_str()]).check_run()
} }
pub fn run_zplugin(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error> {
let zsh = require("zsh")?;
let zshrc = zshrc(base_dirs).require()?;
env::var("ZPLGM[HOME_DIR]")
.map(PathBuf::from)
.unwrap_or_else(|_| base_dirs.home_dir().join(".zplugin"))
.require()?;
print_separator("zplugin");
let cmd = format!(
"source {} && zplugin self-update && zplugin update --all",
zshrc.display()
);
run_type.execute(zsh).args(&["-c", cmd.as_str()]).check_run()
}
pub fn run_oh_my_zsh(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error> { pub fn run_oh_my_zsh(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error> {
let zsh = require("zsh")?; let zsh = require("zsh")?;
let zshrc = zshrc(base_dirs).require()?; let zshrc = zshrc(base_dirs).require()?;