Skip to content

Commit

Permalink
fix(mirrors): use 'rg' for regular expressions on Xiaomi links
Browse files Browse the repository at this point in the history
 * This should ultimately resolve issues where the best mirror for
   'cdnorg' got calculated, even if we specifically told the script not to.

 * 'ripgrep' should be also faster, but in this case it brings close to
    zero improvements. This was rather done for simplicity and uniformity,
    considering we use 'rg' in most occasions.
  • Loading branch information
AntoninoScordino committed Oct 31, 2024
1 parent 6fac304 commit 60df73c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extract_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ else
# For Xiaomi: replace '${URL}' with (one of) the fastest mirror
*"d.miui.com"*)
# Do not run this loop in case we're already using one of the reccomended mirrors
if [[ "$(echo "${URL}" | grep -qE '(cdnorg|bkt-sgp-miui-ota-update-alisgp)')" -eq 0 ]]; then
if ! echo "${URL}" | rg -q 'cdnorg|bkt-sgp-miui-ota-update-alisgp'; then
# Set '${URL_ORIGINAL}' and '${FILE_PATH}' in case we might need to roll back
URL_ORIGINAL=$(echo "${URL}" | sed -E 's|(https://[^/]+).*|\1|')
FILE_PATH=${URL#*d.miui.com/}
Expand Down

0 comments on commit 60df73c

Please sign in to comment.