Skip to content

Commit

Permalink
简化脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Sep 4, 2022
1 parent 6813ec3 commit 6be8230
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 40 deletions.
5 changes: 2 additions & 3 deletions android-static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
41 changes: 4 additions & 37 deletions ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6be8230

Please sign in to comment.