Added NP_SKIP_MOD_CHECK env varible, allows skipping mod version check

This commit is contained in:
IQuant 2024-05-24 11:54:51 +03:00
parent c08db2bad2
commit 6e984e570a
3 changed files with 6 additions and 2 deletions

View file

@ -1693,7 +1693,7 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
[[package]] [[package]]
name = "noita-proxy" name = "noita-proxy"
version = "0.5.0" version = "0.5.1"
dependencies = [ dependencies = [
"bitcode", "bitcode",
"clipboard", "clipboard",

View file

@ -3,7 +3,7 @@ members = ["tangled"]
[package] [package]
name = "noita-proxy" name = "noita-proxy"
version = "0.5.0" version = "0.5.1"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -1,4 +1,5 @@
use std::{ use std::{
env,
fs::{self, File}, fs::{self, File},
io, io,
path::{Path, PathBuf}, path::{Path, PathBuf},
@ -273,6 +274,9 @@ fn extract_and_remove_zip(zip_file: PathBuf, extract_to: PathBuf) -> Result<(),
} }
fn is_mod_ok(mod_path: &Path) -> io::Result<bool> { fn is_mod_ok(mod_path: &Path) -> io::Result<bool> {
if env::var_os("NP_SKIP_MOD_CHECK").is_some() {
return Ok(true);
}
if !mod_path.try_exists()? { if !mod_path.try_exists()? {
return Ok(false); return Ok(false);
} }