17 lines · 513 B · Rust
RawDownload
use std::process::Command; fn main() {    let version = Command::new(if cfg!(windows) { "git.exe" } else { "git" })        .args(["describe", "--match=v*\\.*\\.*"])        .output()        .ok()        .and_then(|out| parse_describe(&out.stdout))        .unwrap_or_else(|| env!("CARGO_PKG_VERSION").into());     println!("cargo:rustc-env=GIX_VERSION={version}");} fn parse_describe(input: &[u8]) -> Option<String> {    let input = std::str::from_utf8(input).ok()?;    input.trim().to_owned().into()}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t