Download crates/forge_main/build.rs from SaylorTwift/forgecode: direct link, hf CLI and curl.
- Browser
- Download file 753 Bytes
-
https://huggingface.co/SaylorTwift/forgecode/resolve/main/crates/forge_main/build.rs
- Command line
-
hf download hf://SaylorTwift/forgecode/crates/forge_main/build.rs
-
curl -L -o build.rs https://huggingface.co/SaylorTwift/forgecode/resolve/main/crates/forge_main/build.rs
753 Bytes
| fn clean_version(version: &str) -> String { | |
| // Remove 'v' prefix if present using strip_prefix | |
| version.strip_prefix('v').unwrap_or(version).to_string() | |
| } | |
| fn main() { | |
| // Priority order: | |
| // 1. APP_VERSION environment variable (for CI/CD builds) | |
| // 2. Fallback to dev version | |
| let version = std::env::var("APP_VERSION") | |
| .map(|v| clean_version(&v)) | |
| .unwrap_or_else(|_| "0.1.0-dev".to_string()); | |
| // Make version available to the application | |
| println!("cargo:rustc-env=CARGO_PKG_VERSION={version}"); | |
| // Make version available to the application | |
| println!("cargo:rustc-env=CARGO_PKG_NAME=forge"); | |
| // Ensure rebuild when environment changes | |
| println!("cargo:rerun-if-env-changed=APP_VERSION"); | |
| } | |