Files
1jehuang--jcode/crates/jcode-build-support/examples/write_dev_sidecar.rs
T
wehub-resource-sync a789495a98
FreeBSD Smoke / FreeBSD Smoke (x86_64) (push) Has been cancelled
CI / Quality Guardrails (push) Has been cancelled
CI / Build & Test (macos-latest) (push) Has been cancelled
CI / Build & Test (ubuntu-latest) (push) Has been cancelled
CI / Build & Test (windows-latest) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / PowerShell Syntax (push) Has been cancelled
CI / Windows Cross-Target Check (Linux) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:10:34 +08:00

18 lines
791 B
Rust

//! Write the dev-binary source metadata sidecar for the current repo state.
//!
//! Self-dev helper: after a direct `scripts/dev_cargo.sh build` (outside the
//! coordinated build queue), the freshly built `target/selfdev/jcode` has no
//! up-to-date `.source.json` sidecar, so `selfdev reload` refuses to publish
//! it. Run this to stamp the binary with the *current* source state:
//!
//! ```sh
//! cargo run -p jcode-build-support --example write_dev_sidecar
//! ```
fn main() -> anyhow::Result<()> {
let repo = std::env::current_dir()?;
let state = jcode_build_support::current_source_state(&repo)?;
let path = jcode_build_support::write_current_dev_binary_source_metadata(&repo, &state)?;
println!("wrote {} for {}", path.display(), state.version_label);
Ok(())
}