mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
* test: assert against specific rust version defined by rust-toolchain.toml * test: assert cargo workspace version * test: assert specific rust version in integration tests * test: fix wrong rust version need to add a .tool-version in another PR
22 lines
498 B
Rust
22 lines
498 B
Rust
use std::process::Command;
|
|
|
|
fn main() {
|
|
let output = Command::new("rustc")
|
|
.arg("--version")
|
|
.output()
|
|
.expect("Failed to execute rustc");
|
|
|
|
let version = String::from_utf8(output.stdout)
|
|
.expect("Invalid UTF-8 in rustc output")
|
|
.trim()
|
|
.to_string();
|
|
|
|
let simplified_version = version
|
|
.split('(')
|
|
.next()
|
|
.unwrap_or(&version)
|
|
.trim();
|
|
|
|
println!("cargo:rustc-env=RUST_VERSION={}", simplified_version);
|
|
}
|