Skip to content

Commit 478152e

Browse files
committed
Merge branch 'test' into fix-1.11
2 parents 53f40e0 + 579e6c4 commit 478152e

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

action.yaml

+29-8
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,36 @@ runs:
143143
144144
curl -sL ${URL}/archive/refs/tags/v${VERSION}.tar.gz | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
145145
146-
set -x
147-
./install.sh "${LIBDIR}"
148-
mv -v "$HOME/.local/share/bats/bin/bats" "$HOME/.local/bin/bats"
149-
set +x
146+
# Archlinux style, except that we are not in a fakeroot env
147+
# https://gitlab.archlinux.org/archlinux/packaging/packages/bash-bats/-/blob/main/PKGBUILD
148+
149+
# TODO: we may consider to use the upstream install.sh script now
150+
# but it will be necessary to do some changes to support all the path
151+
# both in / and home directory 'cause the action can be used in any
152+
# and the cache needs to cover all the files
153+
if [ -f libexec/bats-core/bats-gather-tests ]; then
154+
# TODO: find a better way to understand if the version of bats is =< 1.10
155+
# without installing semver binaries.
156+
sed 's|libexec|lib|g' -i \
157+
bin/* \
158+
libexec/bats-core/* \
159+
lib/bats-core/* \
160+
test/*.bats \
161+
mv -v libexec/bats-core/* lib/bats-core/
162+
install -Dm 755 bin/bats -t "${DESTDIR}/bats"
163+
install -Dm 644 lib/bats-core/* -t "${LIBDIR}"
164+
else
165+
sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats
166+
sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' libexec/bats-core/*
167+
sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' lib/bats-core/*
168+
for fn in libexec/bats-core/*; do
169+
install -Dm755 ${fn} \
170+
${LIBDIR}/$(basename ${fn})
171+
done
172+
install -Dm755 bin/bats "${DESTDIR}/bats"
173+
install -Dm755 lib/bats-core/* -t "${LIBDIR}"
174+
fi
150175
151-
echo "DEBUG: $(command -v bats)"
152-
echo "DEBUG: $(ls -l $HOME/.local/bin/bats)"
153-
echo "DEBUG: $(ls -l ${DESTDIR})"
154-
echo "DEBUG: $(ls -l ${LIBDIR})"
155176
echo "Bats v$VERSION installed in $DESTDIR"
156177
echo "$DESTDIR" >> "$GITHUB_PATH"
157178
echo "bats-installed=true" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)