Skip to content

Commit c1cfe73

Browse files
committed
GH/scripts/environment.sh: add -o pipefail
Try to set -o pipefail. The option should be supported since POSIX v8 (2024). Of course it is supported by shells like bash/zsh long time ago but it was added to dash [here], which is merged to dash 5.13, so it is not in any Ubuntu version yet. So adding '|| true' to suppress omission. XIMEA URL extraction must have been updated 'sed -e "... q"' causes broken pipe, which becomes now fatal. [here]: https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=6347b9fc52d742f36a0276cdea06cd9ad1f02c77
1 parent 040c5c7 commit c1cfe73

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/scripts/environment.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
## password $KEY_FILE_PASS)
1111

1212
set -eu
13+
set -o pipefail || true
1314

1415
if expr "$GITHUB_REF" : 'refs/tags/' >/dev/null; then
1516
TAG=${GITHUB_REF#refs/tags/}
@@ -155,7 +156,7 @@ set_ximea_url() {
155156
ximea_path=$(curl -f https://www.ximea.com/software-downloads |
156157
grep -v 35adfeed-8e15-4b4d-8364-bd5a65cba5c4 |
157158
sed -n "/$ximea_pattern/"\
158-
' { s-^.*\(/getattachment[^"]*\).*$-\1-; p; q; }')
159+
' { s-^.*\(/getattachment[^"]*\).*$-\1-; p; }' | head -n 1)
159160
XIMEA_DOWNLOAD_URL=https://www.ximea.com$ximea_path
160161
export XIMEA_DOWNLOAD_URL
161162
printf "XIMEA_DOWNLOAD_URL=%s\n" "$XIMEA_DOWNLOAD_URL" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)