Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ostool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions ostool/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ impl AppContext {
.config
.build_dir
.as_ref()
.map(|d| normalize(d))
.map(&normalize)
.transpose()?;

let bin_dir = self
.paths
.config
.bin_dir
.as_ref()
.map(|d| normalize(d))
.map(normalize)
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent function pointer syntax: Line 88 uses map(&normalize) while line 96 uses map(normalize). Both approaches work in Rust, but for consistency within the same code block, they should use the same style. Consider using the same syntax for both calls.

Suggested change
.map(normalize)
.map(&normalize)

Copilot uses AI. Check for mistakes.
.transpose()?;

let mut builder = CargoBuilder::run(self, config, build_config_path);
Expand Down
11 changes: 1 addition & 10 deletions ostool/src/run/qemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions ostool/src/run/uboot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down