Skip to content

Commit 38245a3

Browse files
Update src/utils/build/normalize.rs
Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
1 parent a1d1ab9 commit 38245a3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/utils/build/normalize.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ use walkdir::WalkDir;
1616
use zip::write::SimpleFileOptions;
1717
use zip::{DateTime, ZipWriter};
1818

19-
fn get_version() -> String {
20-
std::env::var("SENTRY_CLI_VERSION_OVERRIDE").unwrap_or_else(|_| VERSION.to_owned())
19+
fn get_version() -> Cow<'static, str> {
20+
let version = Cow::Borrowed(VERSION);
21+
22+
#[cfg(test)]
23+
let version = std::env::var("SENTRY_CLI_VERSION_OVERRIDE")
24+
.map(Cow::Owned)
25+
.unwrap_or(version);
26+
27+
version
2128
}
2229

2330
fn sort_entries(path: &Path) -> Result<impl Iterator<Item = (PathBuf, PathBuf)>> {

0 commit comments

Comments
 (0)