download: Get latest build from last match instead of sorting
This fails for 12L: SP2A.220305.013.A3 < SQ1D.220205.004. Google always adds builds to the bottom anyway, so just pick the last matched URL.
This commit is contained in:
parent
4e0a7e1af2
commit
95f25fde97
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ async function getUrl(type: ImageType, buildId: string, device: string, cache: I
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildId == 'latest') {
|
if (buildId == 'latest') {
|
||||||
return matches.map(m => m[1]).sort((a, b) => b.localeCompare(a))[0]
|
return matches[matches.length - 1][1]
|
||||||
}
|
}
|
||||||
return matches[0][1]
|
return matches[0][1]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue