Add rcm step (#91)

This commit is contained in:
Rebecca Turner
2022-10-31 02:05:12 -04:00
committed by GitHub
parent 18cec5c9fa
commit d8bac65317
3 changed files with 16 additions and 0 deletions

View File

@@ -122,6 +122,7 @@ pub enum Step {
Powershell,
Protonup,
Raco,
Rcm,
Remotes,
Restarts,
Rtcl,

View File

@@ -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(

View File

@@ -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: <https://github.com/thoughtbot/rcm>
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();