MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda / get_zig_version

Function get_zig_version

crates/cargo-lambda-build/src/zig.rs:79–103  ·  view source on GitHub ↗
(
    path: PathBuf,
    run_modifiers: Vec<String>,
)

Source from the content-addressed store, hash-verified

77}
78
79fn get_zig_version(
80 path: PathBuf,
81 run_modifiers: Vec<String>,
82) -> std::result::Result<ZigInfo, miette::Error> {
83 let mut cmd = Command::new(&path);
84 cmd.args(&run_modifiers);
85 cmd.arg("version");
86 let output = cmd.output().into_diagnostic()?;
87 let version = String::from_utf8(output.stdout)
88 .into_diagnostic()?
89 .trim()
90 .to_string();
91
92 let mut command = format!("{}", path.display());
93 if !run_modifiers.is_empty() {
94 command.push(' ');
95 command.push_str(&run_modifiers.join(" "));
96 };
97
98 Ok(ZigInfo {
99 command: Some(command),
100 version: Some(version),
101 ..Default::default()
102 })
103}
104
105#[derive(Clone, Debug)]
106pub enum InstallOption {

Callers 2

check_installationFunction · 0.85
get_zig_infoFunction · 0.85

Calls 3

newFunction · 0.85
pushMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected