Skip to content

Commit 82202e5

Browse files
authored
Fix lychee version check (#288)
1 parent 52af768 commit 82202e5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

entrypoint.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ fi
4444

4545
CHECKBOX=""
4646
if [ "${INPUT_CHECKBOX}" = true ]; then
47-
# Check if the version is higher than 0.18.1
48-
if [ "$(lychee --version | head -n1 | cut -d" " -f4)" -lt 0.18.1 ]; then
49-
echo "WARNING: 'checkbox' is not supported in lychee versions lower than 0.18.1. Continuing without 'checkbox'."
47+
# Warn if the version is lower than 0.18.1
48+
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
49+
lychee_version="$(lychee --version | head -n1 | cut -d" " -f2)"
50+
if version_lt "$lychee_version" "0.18.1"; then
51+
echo "WARNING: 'checkbox' is not supported in lychee versions lower than 0.18.1 (current is $lychee_version). Continuing without 'checkbox'."
5052
else
5153
CHECKBOX="--mode task"
5254
fi

0 commit comments

Comments
 (0)