frontend: source: Try more specific dirs first

This commit is contained in:
Danny Lin 2021-12-17 15:09:56 -08:00
parent ab2c1e72ba
commit 9fd0e1a146

View file

@ -188,18 +188,21 @@ export async function wrapSystemSrc(
// Directory // Directory
let tryDirs = [ let tryDirs = [
src,
`${src}/${device}`,
...(buildId != null && [ ...(buildId != null && [
`${src}/${buildId}`, `${src}/${buildId}`,
`${src}/${device}/${buildId}`, `${src}/${device}/${buildId}`,
`${src}/${buildId}/${device}`, `${src}/${buildId}/${device}`,
] || []), ] || []),
`${src}/${device}`,
src,
] ]
// Also try to find extracted factory images: device-buildId // Also try to find extracted factory images first: device-buildId
if (buildId != null) { if (buildId != null) {
tryDirs.push(...tryDirs.map(p => `${p}/${device}-${buildId}`)) tryDirs = [
...tryDirs.map(p => `${p}/${device}-${buildId}`),
...tryDirs,
]
} }
for (let dir of tryDirs) { for (let dir of tryDirs) {