Add first offsets config for linux

This commit is contained in:
Albert24GG
2024-03-06 10:35:48 +02:00
parent 6a1600d432
commit 7e573bdcb6
4 changed files with 142 additions and 4 deletions

View File

@@ -72,3 +72,9 @@ pub const PROC_NAME: &str = "cs2.exe";
#[cfg(target_os = "linux")]
pub const PROC_NAME: &str = "cs2";
#[cfg(target_os = "windows")]
pub const OFFSETS_CONF: &str = "config.json";
#[cfg(target_os = "linux")]
pub const OFFSETS_CONF: &str = "config_linux.json";

View File

@@ -7,8 +7,8 @@ use simplelog::{debug, error, info};
use super::{generate_files, Entries, Entry};
use crate::builder::FileBuilderEnum;
use crate::config::Config;
use crate::config::Operation::*;
use crate::config::{self, Config};
use crate::os::Process;
pub fn dump_offsets(
@@ -17,7 +17,7 @@ pub fn dump_offsets(
file_path: &str,
indent: usize,
) -> Result<()> {
let file = File::open("config.json")?;
let file = File::open(config::OFFSETS_CONF)?;
let config: Config = serde_json::from_reader(file)?;

View File

@@ -86,8 +86,8 @@ fn main() -> Result<()> {
TermLogger::init(log_level, config, TerminalMode::Mixed, ColorChoice::Auto)?;
if !Path::new("config.json").exists() {
bail!("Missing config.json file");
if !Path::new(config::OFFSETS_CONF).exists() {
bail!("Missing {} file", config::OFFSETS_CONF);
}
// Create the output directory if it doesn't exist.