Returns the deployed engine version from `ENGINE_TAG_VERSION` when it is set to a non-empty value, otherwise falls back to the build-time version embedded in the binary, then to the shadow-rs commit ID when the embedded version is absent or invalid.
(
build_version_fallback: &str,
shadow_commit_fallback: &str,
)
| 105 | /// value, otherwise falls back to the build-time version embedded in the binary, then to the |
| 106 | /// shadow-rs commit ID when the embedded version is absent or invalid. |
| 107 | pub fn load_deployed_engine_version( |
| 108 | build_version_fallback: &str, |
| 109 | shadow_commit_fallback: &str, |
| 110 | ) -> DeployedEngineVersion { |
| 111 | let runtime_engine_version = env::var("ENGINE_TAG_VERSION").ok(); |
| 112 | parse_deployed_engine_version( |
| 113 | runtime_engine_version.as_deref(), |
| 114 | build_version_fallback, |
| 115 | shadow_commit_fallback, |
| 116 | ) |
| 117 | } |
| 118 | |
| 119 | #[cfg(test)] |
| 120 | mod tests { |
no test coverage detected