@@ -143,35 +143,38 @@ runs:
143
143
144
144
curl -sL ${URL}/archive/refs/tags/v${VERSION}.tar.gz | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
145
145
146
+ ./install.sh "$HOME/.local/share/bats"
147
+ mv "$HOME/.local/share/bats/bin/bats" "$HOME/.local/bin"
148
+
146
149
# Archlinux style, except that we are not in a fakeroot env
147
150
# https://gitlab.archlinux.org/archlinux/packaging/packages/bash-bats/-/blob/main/PKGBUILD
148
151
149
- # TODO: find a better way to understand if the version of bats is =< 1.10
150
- # without installing semver binaries.
151
- # TODO: we may consider to use the upstream install.sh script now
152
- if [ -f libexec/bats-core/bats-gather-tests ]; then
153
- sed -i 's|BATS_BASE_LIBDIR=lib|BATS_BASE_LIBDIR=share|g' bin/bats
154
- sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats
155
- sed -i 's|BATS_ROOT/$BATS_LIBDIR/bats-core/|BATS_ROOT/$BATS_LIBDIR/bats/|g' libexec/bats-core/*
156
- sed -i 's|BATS_ROOT/$BATS_LIBDIR/bats-core/|BATS_ROOT/$BATS_LIBDIR/bats/|g' lib/bats-core/*
157
- # TODO: open a PR upstream
158
- # this: https://github.com/bats-core/bats-core/blob/12c23eda62065af5e4c80cc81a28a4ce4af34224/libexec/bats-core/bats-gather-tests#L10-L12
159
- # should use the new $BATS_LIBDIR?
160
- sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' libexec/bats-core/*
161
- sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' lib/bats-core/*
162
- else
163
- sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats
164
- sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' libexec/bats-core/*
165
- sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' lib/bats-core/*
166
- fi
152
+ ## TODO: find a better way to understand if the version of bats is =< 1.10
153
+ ## without installing semver binaries.
154
+ ## TODO: we may consider to use the upstream install.sh script now
155
+ # if [ -f libexec/bats-core/bats-gather-tests ]; then
156
+ # sed -i 's|BATS_BASE_LIBDIR=lib|BATS_BASE_LIBDIR=share|g' bin/bats
157
+ # sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats
158
+ # sed -i 's|BATS_ROOT/$BATS_LIBDIR/bats-core/|BATS_ROOT/$BATS_LIBDIR/bats/|g' libexec/bats-core/*
159
+ # sed -i 's|BATS_ROOT/$BATS_LIBDIR/bats-core/|BATS_ROOT/$BATS_LIBDIR/bats/|g' lib/bats-core/*
160
+ # # TODO: open a PR upstream
161
+ # # this: https://github.com/bats-core/bats-core/blob/12c23eda62065af5e4c80cc81a28a4ce4af34224/libexec/bats-core/bats-gather-tests#L10-L12
162
+ # # should use the new $BATS_LIBDIR?
163
+ # sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' libexec/bats-core/*
164
+ # sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' lib/bats-core/*
165
+ # else
166
+ # sed -i 's|BATS_ROOT/libexec/bats-core/bats|BATS_ROOT/share/bats/bats|g' bin/bats
167
+ # sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' libexec/bats-core/*
168
+ # sed -i 's|BATS_ROOT/lib/bats-core/|BATS_ROOT/share/bats/|g' lib/bats-core/*
169
+ # fi
167
170
168
- for fn in libexec/bats-core/*; do
169
- install -Dm755 ${fn} \
170
- ${LIBDIR}/$(basename ${fn})
171
- done
171
+ # for fn in libexec/bats-core/*; do
172
+ # install -Dm755 ${fn} \
173
+ # ${LIBDIR}/$(basename ${fn})
174
+ # done
172
175
173
- install -Dm755 bin/bats "${DESTDIR}/bats"
174
- install -Dm755 lib/bats-core/* -t "${LIBDIR}"
176
+ # install -Dm755 bin/bats "${DESTDIR}/bats"
177
+ # install -Dm755 lib/bats-core/* -t "${LIBDIR}"
175
178
176
179
echo "Bats v$VERSION installed in $DESTDIR"
177
180
echo "$DESTDIR" >> "$GITHUB_PATH"
0 commit comments