From 9fd0e1a146814af2fdcdd3a80ad9ed4965e1e3e6 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Fri, 17 Dec 2021 15:09:56 -0800 Subject: [PATCH] frontend: source: Try more specific dirs first --- src/frontend/source.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/frontend/source.ts b/src/frontend/source.ts index 8992349..bd1f928 100644 --- a/src/frontend/source.ts +++ b/src/frontend/source.ts @@ -188,18 +188,21 @@ export async function wrapSystemSrc( // Directory let tryDirs = [ - src, - `${src}/${device}`, ...(buildId != null && [ `${src}/${buildId}`, `${src}/${device}/${buildId}`, `${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) { - tryDirs.push(...tryDirs.map(p => `${p}/${device}-${buildId}`)) + tryDirs = [ + ...tryDirs.map(p => `${p}/${device}-${buildId}`), + ...tryDirs, + ] } for (let dir of tryDirs) {