From 45bf672667470aef8a9b79aa9ee19dd2efa68df7 Mon Sep 17 00:00:00 2001 From: j-hc Date: Sun, 29 Sep 2024 14:02:25 +0300 Subject: [PATCH] fixes --- build.sh | 8 +++++--- utils.sh | 9 ++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 70b36e20ce..865f548fa5 100755 --- a/build.sh +++ b/build.sh @@ -50,6 +50,8 @@ java --version >/dev/null || abort "\`openjdk 17\` is not installed. install it zip --version >/dev/null || abort "\`zip\` is not installed. install it with 'apt install zip' or equivalent" # ---------------- rm -rf revanced-magisk/bin/*/tmp.* +: >"$TEMP_DIR"/*-rv/changelog.md || : + get_prebuilts declare -A cliriplib @@ -160,14 +162,14 @@ for table_name in $(toml_get_table_names); do done wait rm -rf temp/tmp.* -if [ -z "$(ls -A1 ${BUILD_DIR})" ]; then abort "All builds failed."; fi +if [ -z "$(ls -A1 "${BUILD_DIR}")" ]; then abort "All builds failed."; fi log "\nInstall [Microg](https://github.com/ReVanced/GmsCore/releases) for non-root YouTube and YT Music APKs" log "Use [zygisk-detach](https://github.com/j-hc/zygisk-detach) to detach root ReVanced YouTube and YT Music from Play Store" log "\n[revanced-magisk-module](https://github.com/j-hc/revanced-magisk-module)\n" -log "$(cat $TEMP_DIR/*-rv/changelog.md)" +log "$(cat "$TEMP_DIR"/*-rv/changelog.md)" -SKIPPED=$(cat $TEMP_DIR/skipped 2>/dev/null || :) +SKIPPED=$(cat "$TEMP_DIR"/skipped 2>/dev/null || :) if [ -n "$SKIPPED" ]; then log "\nSkipped:" log "$SKIPPED" diff --git a/utils.sh b/utils.sh index 3cc1b4666b..945b340fb7 100755 --- a/utils.sh +++ b/utils.sh @@ -67,10 +67,6 @@ get_rv_prebuilts() { local url file tag_name name file=$(find "$dir" -name "revanced-${tag,,}-${name_ver#v}.${ext}" -type f 2>/dev/null) - if [ "$ver" = "latest" ]; then - file=$(grep -v dev <<<"$file" | head -1) - else file=$(grep "$ver" <<<"$file" | head -1); fi - if [ -z "$file" ]; then local resp asset name resp=$(gh_req "$rv_rel" -) || return 1 @@ -84,10 +80,13 @@ get_rv_prebuilts() { if [ "$tag" = "Integrations" ]; then integs_file=$file; fi echo "$tag: $(cut -d/ -f1 <<<"$src")/${name} " >>"${cl_dir}/changelog.md" else + if [ "$ver" = "latest" ]; then + file=$(grep -v dev <<<"$file" | head -1) + else file=$(grep "${ver#v}" <<<"$file" | head -1); fi name=$(basename "$file") tag_name=$(cut -d'-' -f3- <<<"$name") tag_name=v${tag_name%.*} - if [ "$tag_name" = "v" ]; then abort; fi + if [ "$tag_name" = "v" ]; then abort "wrong ver"; fi fi echo -n "$file "