-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adapt to fib-jws@>=0.2.4 (#14)
* feat: adapt to fib-jws@>=2. - keep fib-session's behavior against change from [break in fib-jws](fibjs/fib-jws@9657a1b) * feat: add option `disable_auto_hex_key`. * ci: fix port usage on ci. * feat: drop support for 0.33.x
- Loading branch information
1 parent
530e15b
commit cdfcb2c
Showing
9 changed files
with
263 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
|
||
vercomp () { | ||
if [[ $1 == $2 ]]; then | ||
export vercomp_last_result=0 | ||
return $vercomp_last_result | ||
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 | ||
export vercomp_last_result=1 | ||
return $vercomp_last_result | ||
fi | ||
if ((10#${ver1[i]} < 10#${ver2[i]})); then | ||
export vercomp_last_result=2 | ||
return $vercomp_last_result | ||
fi | ||
done | ||
export vercomp_last_result=0 | ||
return $vercomp_last_result | ||
} | ||
|
||
install_fibjs() { | ||
local version=$1 | ||
if [[ -z "$version" ]]; then | ||
echo "[install_fibjs] version is required" | ||
exit 1 | ||
fi | ||
local os=$2 | ||
if [[ -z "$os" ]]; then | ||
echo "[install_fibjs] os is required" | ||
exit 1 | ||
fi | ||
local arch=$3 | ||
if [[ -z "$arch" ]]; then | ||
echo "[install_fibjs] arch is required" | ||
exit 1 | ||
fi | ||
|
||
local url_base="https://github.com/fibjs/fibjs/releases/download/v${version}/fibjs-v${version}-${os}-${arch}" | ||
|
||
# in fact, there's also non-archived linux fibjs | ||
if [[ "$RUNNER_OS" == "Linux" ]]; then | ||
if [ "$lower_than_0_37_0" == "true" ]; then | ||
local remote_url="${url_base}.xz" | ||
curl -SL "$remote_url" -o ./node_modules/.bin/fibjs.xz; | ||
xz -d ./node_modules/.bin/fibjs.xz; | ||
else | ||
local remote_url="${url_base}.tar.gz" | ||
curl -SL "$remote_url" -o ./node_modules/.bin/fibjs.tar.gz; | ||
tar -xzf ./node_modules/.bin/fibjs.tar.gz -C ./node_modules/.bin; | ||
fi | ||
chmod a+x ./node_modules/.bin/fibjs; | ||
elif [[ "$RUNNER_OS" == "macOS" ]]; then | ||
local remote_url="${url_base}" | ||
curl -SL "$remote_url" -o ./node_modules/.bin/fibjs; | ||
chmod a+x ./node_modules/.bin/fibjs; | ||
else | ||
local remote_url="${url_base}.exe" | ||
curl -SL "$remote_url" -o ./node_modules/.bin/fibjs.exe; | ||
fi | ||
echo "[install_fibjs] Downloading fibjs from ${remote_url}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.