mirror of
https://github.com/a2x/cs2-dumper.git
synced 2025-09-18 12:50:01 +08:00
Add first offsets config for linux
This commit is contained in:
@@ -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";
|
||||
|
@@ -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)?;
|
||||
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user