From 6be82301136b7844954fb163b293f035ff29e863 Mon Sep 17 00:00:00 2001 From: johnche Date: Sun, 4 Sep 2022 12:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android-static.sh | 5 ++--- ios.sh | 41 ++++------------------------------------- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/android-static.sh b/android-static.sh index 2222651..2a4f3f7 100755 --- a/android-static.sh +++ b/android-static.sh @@ -68,10 +68,9 @@ cp \ ../puerts-node/nodejs/lib/Android/$OUTPUT/ function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } -if version_gt $VERSION "16"; then -echo "do nothing" -else +if version_lt $VERSION "16"; then cp out/Release/obj.target/tools/v8_gypfiles/libv8_libsampler.a \ ../puerts-node/nodejs/lib/Android/$OUTPUT/ fi diff --git a/ios.sh b/ios.sh index d495d77..c330e33 100644 --- a/ios.sh +++ b/ios.sh @@ -98,42 +98,9 @@ cp \ out/Release/obj/tools/v8_gypfiles/libv8_initializers.a \ ../puerts-node/nodejs/lib/iOS/ -vercomp () { - if [[ $1 == $2 ]] - then - return 0 - fi - local IFS=. - local i ver1=($1) ver2=($2) - # fill empty fields in ver1 with zeros - for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) - do - ver1[i]=0 - done - for ((i=0; i<${#ver1[@]}; i++)) - do - if [[ -z ${ver2[i]} ]] - then - # fill empty fields in ver2 with zeros - ver2[i]=0 - fi - if ((10#${ver1[i]} > 10#${ver2[i]})) - then - return 1 - fi - if ((10#${ver1[i]} < 10#${ver2[i]})) - then - return 2 - fi - done - return 0 -} - -vercomp "16" $VERSION - -if [ $? == 2 ] -then -echo "do nothing" -else +function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } + +if version_lt $VERSION "16"; then cp out/Release/obj/tools/v8_gypfiles/libv8_libsampler.a ../puerts-node/nodejs/lib/iOS/ fi