From f54d46ab2be9d8093fa4df818025b8c618a75c7d Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Wed, 4 Sep 2019 21:36:35 +0300 Subject: [PATCH] Upgrade oh-my-zsh (fix #215) --- README.md | 2 +- src/main.rs | 7 ++++++- src/steps/os/unix.rs | 8 ++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 54d63501..8614da78 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,6 @@ Just run `topgrade`. It will run the following steps: * Check if the following paths are tracked by Git. If so, pull them: * ~/.emacs.d (Should work whether you use [Spacemacs](http://spacemacs.org/) or a custom configuration) * ~/.zshrc - * [~/.oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) * ~/.tmux * ~/.config/fish * ~/.config/nvim @@ -76,6 +75,7 @@ Just run `topgrade`. It will run the following steps: * Powershell Profile * Custom defined paths * **Unix**: Run [zplug](https://github.com/zplug/zplug) update +* **Unix**: Run [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) update * **Unix**: Run [fisher](https://github.com/jorgebucaran/fisher) * **Unix**: Upgrade tmux plugins with [TPM](https://github.com/tmux-plugins/tpm). *Note*: Do not use the `-b` flag in your configuration as suggested by the TPM readme. diff --git a/src/main.rs b/src/main.rs index cd4b7073..0a6189de 100644 --- a/src/main.rs +++ b/src/main.rs @@ -224,7 +224,6 @@ fn run() -> Result<(), Error> { #[cfg(unix)] { git_repos.insert(base_dirs.home_dir().join(".zshrc")); - git_repos.insert(base_dirs.home_dir().join(".oh-my-zsh")); git_repos.insert(base_dirs.home_dir().join(".tmux")); git_repos.insert(base_dirs.home_dir().join(".config/fish")); git_repos.insert(base_dirs.config_dir().join("openbox")); @@ -267,6 +266,12 @@ fn run() -> Result<(), Error> { || unix::run_zplug(&base_dirs, run_type), config.no_retry(), )?; + execute( + &mut report, + "oh-my-zsh", + || unix::run_oh_my_zsh(run_type), + config.no_retry(), + )?; execute( &mut report, "fisher", diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index 162c8de8..434640d1 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -26,6 +26,14 @@ pub fn run_zplug(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error> { run_type.execute(zsh).args(&["-c", cmd.as_str()]).check_run() } +pub fn run_oh_my_zsh(run_type: RunType) -> Result<(), Error> { + let upgrade = require("upgrade_oh_my_zsh")?; + + print_separator("oh-my-zsh"); + + run_type.execute(upgrade).check_run() +} + pub fn run_fisher(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error> { let fish = require("fish")?; base_dirs