Skip to content

Commit 38f5829

Browse files
committed
Fix find_app file matching bug
It could match on dev builds when specifying a stable build. Add back sorting by file name length, which on ok solution to this problem.
1 parent f88b740 commit 38f5829

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/test-manager/src/package.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::config::{Architecture, OsType, PackageType, VmConfig};
22
use anyhow::{Context, Result};
3+
use itertools::Itertools;
34
use once_cell::sync::Lazy;
45
use regex::Regex;
56
use std::path::{Path, PathBuf};
@@ -124,6 +125,7 @@ fn find_app(
124125
// Skip for non-Linux, because there's only one package
125126
!linux || matching_ident
126127
}) // Skip file if it doesn't match the architecture
128+
.sorted_unstable_by_key(|(_path, u8_path)| u8_path.len())
127129
.find(|(_path, u8_path)| u8_path.contains(&app)) // Find match
128130
.map(|(path, _)| path).context(if e2e_bin {
129131
format!(

0 commit comments

Comments
 (0)