Skip to content

Commit

Permalink
fix: replace - with .
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-ippolito committed Apr 26, 2023
1 parent 1eaaa62 commit 197642a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tools/dep_updaters/update-icu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ NEW_VERSION="$("$NODE" --input-type=module <<'EOF'
const res = await fetch('https://api.github.com/repos/unicode-org/icu/releases/latest');
if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
const { tag_name } = await res.json();
console.log(tag_name.replace('release-', ''));
console.log(tag_name.replace('release-', '').replace('-','.'));
EOF
)"

ICU_VERSION_H="$DEPS_DIR/icu-small/source/common/unicode/uvernum.h"
CURRENT_MAJOR_VERSION=$(grep "#define U_ICU_VERSION_MAJOR_NUM" "$ICU_VERSION_H" | cut -d ' ' -f3 | tr -d '\r')
CURRENT_MINOR_VERSION=$(grep "#define U_ICU_VERSION_MINOR_NUM" "$ICU_VERSION_H" | cut -d ' ' -f3 | tr -d '\r')

CURRENT_VERSION="$CURRENT_MAJOR_VERSION-$CURRENT_MINOR_VERSION"
CURRENT_VERSION="$(grep "#define U_ICU_VERSION " "$ICU_VERSION_H" | cut -d'"' -f2)"

echo "Comparing $NEW_VERSION with $CURRENT_VERSION"

Expand All @@ -30,8 +28,8 @@ if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then
exit 0
fi

NEW_MAJOR_VERSION=$(echo "$NEW_VERSION" | cut -d '-' -f1)
NEW_MINOR_VERSION=$(echo "$NEW_VERSION" | cut -d '-' -f2)
NEW_MAJOR_VERSION=$(echo "$NEW_VERSION" | cut -d '.' -f1)
NEW_MINOR_VERSION=$(echo "$NEW_VERSION" | cut -d '.' -f2)

NEW_VERSION_TGZ="https://github.com/unicode-org/icu/releases/download/release-${NEW_VERSION}/icu4c-${NEW_MAJOR_VERSION}_${NEW_MINOR_VERSION}-src.tgz"

Expand Down

0 comments on commit 197642a

Please sign in to comment.