diff --git a/src/config.rs b/src/config.rs index b9743d24..bcfda1f1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -121,6 +121,7 @@ pub enum Step { Powershell, Protonup, Raco, + Rcm, Remotes, Restarts, Rtcl, diff --git a/src/main.rs b/src/main.rs index b7da2e4c..10c68d4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -231,6 +231,10 @@ fn run() -> Result<()> { git_repos.insert_if_repo(base_dirs.home_dir().join(".ideavimrc")); git_repos.insert_if_repo(base_dirs.home_dir().join(".intellimacs")); + if config.should_run(Step::Rcm) { + git_repos.insert_if_repo(base_dirs.home_dir().join(".dotfiles")); + } + #[cfg(unix)] { git_repos.insert_if_repo(zsh::zshrc(&base_dirs)); @@ -301,6 +305,7 @@ fn run() -> Result<()> { runner.execute(Step::Sdkman, "SDKMAN!", || { unix::run_sdkman(&base_dirs, config.cleanup(), run_type) })?; + runner.execute(Step::Rcm, "rcm", || unix::run_rcm(&ctx))?; } #[cfg(not(any( diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index 836e75a3..c28b92ee 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -457,6 +457,16 @@ pub fn run_bun(ctx: &ExecutionContext) -> Result<()> { ctx.run_type().execute(&bun).arg("upgrade").check_run() } +/// Update dotfiles with `rcm(7)`. +/// +/// See: +pub fn run_rcm(ctx: &ExecutionContext) -> Result<()> { + let rcup = require("rcup")?; + + print_separator("rcm"); + ctx.run_type().execute(rcup).arg("-v").check_run() +} + pub fn reboot() { print!("Rebooting..."); Command::new("sudo").arg("reboot").spawn().unwrap().wait().unwrap();