Skip to content

Commit 04bced9

Browse files
committed
fix(check): Add a flag and document strict last mod installed
Signed-off-by: dark0dave <[email protected]>
1 parent 8250aa5 commit 04bced9

File tree

7 files changed

+35
-7
lines changed

7 files changed

+35
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mod_installer"
3-
version = "11.1.1"
3+
version = "11.1.2"
44
edition = "2021"
55
authors = [ "dark0dave" ]
66
documentation = "https://raw.githubusercontent.com/dark0dave/mod_installer/main/README.md"

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,17 @@ These flags work for either of the above commands
367367
368368
> Example: --strict-matching
369369
370+
* -c, --check_last_installed
371+
372+
373+
> What it does: This has the mod_installer compare what it just installed vs the last line in the weidu.log file.
374+
375+
> How to use it: Just add this option to your command if you want to use it.
376+
377+
> Default: This is off by default.
378+
379+
> Example: -c --check_last_installed
380+
370381
* -V, --version
371382

372383

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ pkgs ? import <nixpkgs> { } }:
22
pkgs.rustPlatform.buildRustPackage rec {
33
pname = "mod_installer";
4-
version = "11.1.1";
4+
version = "11.1.2";
55
cargoLock.lockFile = ./Cargo.lock;
66
src = pkgs.lib.cleanSource ./.;
77
buildInputs = with pkgs; [

src/component.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ pub(crate) struct Component {
1616
impl PartialEq for Component {
1717
fn eq(&self, other: &Self) -> bool {
1818
self.tp_file == other.tp_file
19-
&& self.name == other.name
20-
&& self.lang == other.lang
21-
&& self.component == other.component
19+
&& self.name.to_lowercase() == other.name.to_lowercase()
20+
&& self.lang.to_lowercase() == other.lang.to_lowercase()
21+
&& self.component.to_lowercase() == other.component.to_lowercase()
2222
}
2323
}
2424

src/config/args.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,19 @@ pub(crate) struct Options {
233233
value_parser = BoolishValueParser::new(),
234234
)]
235235
pub(crate) overwrite: bool,
236+
237+
/// Strict weidu log checking
238+
#[clap(
239+
env,
240+
short,
241+
long,
242+
num_args=0..=1,
243+
action = clap::ArgAction::SetTrue,
244+
default_value_t = false,
245+
default_missing_value = "false",
246+
value_parser = BoolishValueParser::new(),
247+
)]
248+
pub(crate) check_last_installed: bool,
236249
}
237250

238251
fn parse_weidu_log_mode(arg: &str) -> Result<String, String> {
@@ -369,6 +382,7 @@ mod tests {
369382
strict_matching: false,
370383
download: true,
371384
overwrite: false,
385+
check_last_installed: false,
372386
},
373387
}),
374388
};
@@ -416,6 +430,7 @@ mod tests {
416430
strict_matching: !expected_flag_value,
417431
download: expected_flag_value,
418432
overwrite: !expected_flag_value,
433+
check_last_installed: !expected_flag_value,
419434
},
420435
generate_directories: false,
421436
new_pre_eet_dir: None,

src/installers.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ pub(crate) fn normal_install(
8181
.into());
8282
}
8383
InstallationResult::Success => {
84-
validate_install(game_dir, weidu_mod)?;
84+
if options.check_last_installed {
85+
validate_install(game_dir, weidu_mod)?;
86+
}
8587
log::info!("Installed mod {:?}", &weidu_mod);
8688
}
8789
InstallationResult::Warnings => {

0 commit comments

Comments
 (0)