diff --git a/Cargo.lock b/Cargo.lock index 47b3618..2a572fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1859,7 +1859,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "ostool" -version = "0.8.4" +version = "0.8.5" dependencies = [ "anyhow", "byte-unit", diff --git a/ostool/Cargo.toml b/ostool/Cargo.toml index f6bf18f..3a8acd6 100644 --- a/ostool/Cargo.toml +++ b/ostool/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" name = "ostool" readme = "../README.md" repository = "https://github.com/ZR233/ostool" -version = "0.8.4" +version = "0.8.5" [[bin]] name = "ostool" diff --git a/ostool/src/build/mod.rs b/ostool/src/build/mod.rs index df783de..09c16df 100644 --- a/ostool/src/build/mod.rs +++ b/ostool/src/build/mod.rs @@ -85,7 +85,7 @@ impl AppContext { .config .build_dir .as_ref() - .map(|d| normalize(d)) + .map(&normalize) .transpose()?; let bin_dir = self @@ -93,7 +93,7 @@ impl AppContext { .config .bin_dir .as_ref() - .map(|d| normalize(d)) + .map(normalize) .transpose()?; let mut builder = CargoBuilder::run(self, config, build_config_path); diff --git a/ostool/src/run/qemu.rs b/ostool/src/run/qemu.rs index 641ae94..0c674c9 100644 --- a/ostool/src/run/qemu.rs +++ b/ostool/src/run/qemu.rs @@ -8,7 +8,6 @@ use std::{ use anyhow::anyhow; use colored::Colorize; use crossterm::terminal::disable_raw_mode; -use jkconfig::data::app_data::default_schema_by_init; use object::Architecture; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -44,15 +43,7 @@ pub async fn run_qemu(ctx: AppContext, args: RunQemuArgs) -> anyhow::Result<()> None => ctx.paths.manifest.join(".qemu.toml"), }; - let schema_path = default_schema_by_init(&config_path); - - let schema = schemars::schema_for!(QemuConfig); - let schema_json = serde_json::to_value(&schema)?; - let schema_content = serde_json::to_string_pretty(&schema_json)?; - fs::write(&schema_path, schema_content).await?; - - // 初始化AppData - // let app_data = AppData::new(Some(&config_path), Some(schema_path))?; + info!("Using QEMU config file: {}", config_path.display()); let config = if config_path.exists() { let config_content = fs::read_to_string(&config_path) diff --git a/ostool/src/run/uboot.rs b/ostool/src/run/uboot.rs index 14c136f..6152bd6 100644 --- a/ostool/src/run/uboot.rs +++ b/ostool/src/run/uboot.rs @@ -307,11 +307,9 @@ impl Runner { .and_then(|net| net.tftp_dir.as_ref()) .is_some(); - if !is_tftp { - if let Some(ip) = ip_string.as_ref() { - info!("TFTP server IP: {}", ip); - tftp::run_tftp_server(&self.ctx)?; - } + if !is_tftp && let Some(ip) = ip_string.as_ref() { + info!("TFTP server IP: {}", ip); + tftp::run_tftp_server(&self.ctx)?; } info!(