Skip to content

Commit

Permalink
Merge pull request #16 from maddymeows/repatch-if-patched
Browse files Browse the repository at this point in the history
cli: unpatch before patching if patched
  • Loading branch information
NotNite authored Jan 16, 2025
2 parents f6d0f20 + 8e278eb commit 1d58436
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/moonlight-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ fn main() -> eyre::Result<()> {
let install = detect_install(&exe);
if let Some(install) = install {
if install.patched {
log::warn!("Install already patched");
std::process::exit(0);
log::warn!("Client mod appears to already be patched - unpatching first");
installer.unpatch_install(&install.install)?;
}

installer.patch_install(&install.install, moonlight)?;
Expand All @@ -72,19 +72,19 @@ fn main() -> eyre::Result<()> {
}
}

Commands::Unpatch { exe: dir } => {
log::info!("Unpatching install at {:?}", dir);
let install = detect_install(&dir);
Commands::Unpatch { exe } => {
log::info!("Unpatching install at {:?}", exe);
let install = detect_install(&exe);
if let Some(install) = install {
if !install.patched {
log::warn!("Install already unpatched");
std::process::exit(0);
}

installer.unpatch_install(&install.install)?;
log::info!("Unpatched install at {:?}", dir);
log::info!("Unpatched install at {:?}", exe);
} else {
log::error!("Failed to detect install at {:?}", dir);
log::error!("Failed to detect install at {:?}", exe);
std::process::exit(1);
}
}
Expand Down

0 comments on commit 1d58436

Please sign in to comment.