Skip to content

Commit f0f1ed9

Browse files
authored
Recent change broke < v5.4 (#35)
* Add version matrix to GitHub actions test * Fix versions lower than 5.4 for linux
1 parent 0ea06ff commit f0f1ed9

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/workflow.yml

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22+
version:
23+
- 5.1.5
24+
- 5.2.4
25+
- 5.3.6
26+
- 5.4.6
2227
os:
2328
- macos-latest
2429
- ubuntu-latest
@@ -41,6 +46,7 @@ jobs:
4146
uses: asdf-vm/actions/plugin-test@v1
4247
with:
4348
command: lua -v
49+
version: ${{ matrix.version }}
4450

4551
lint:
4652
runs-on: ubuntu-latest

bin/install

+16-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ get_target() {
113113
elif [ "${ASDF_LUA_LINUX_READLINE-}" == "1" ]; then
114114
echo "linux-readline"
115115
else # Otherwise let the lua Makefile guess for us
116-
echo "guess"
116+
if less_than_version_5_4x "$version"; then
117+
echo "linux"
118+
else
119+
echo "guess"
120+
fi
117121
fi
118122
}
119123

@@ -150,4 +154,15 @@ version_5_2x_or_greater() {
150154
fi
151155
}
152156

157+
less_than_version_5_4x() {
158+
version=$1
159+
IFS='.' read -ra version_array <<<"$version"
160+
major_minor_version="${version_array[0]}0${version_array[1]}"
161+
if (("$major_minor_version" < 504)); then
162+
return 0
163+
else
164+
return 1
165+
fi
166+
}
167+
153168
install_lua "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH" "$ASDF_DOWNLOAD_PATH"

0 commit comments

Comments
 (0)