From 7d0442ab06fe40864b3af54c2891734c027dc4f8 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Fri, 29 Sep 2023 21:03:39 +0900 Subject: [PATCH] Set errtrace in scripts --- .github/workflows/ci.yml | 8 +++----- main.sh | 2 +- tools/ci/manifest.sh | 2 +- tools/ci/tool-list.sh | 2 +- tools/manifest.sh | 2 +- tools/publish.sh | 2 +- tools/tidy.sh | 2 +- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f866cc4..fdb62e88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,13 +118,13 @@ jobs: steps: - name: Install requirements (ubuntu/debian) run: | - set -euxo pipefail + set -eEuxo pipefail apt-get -o Acquire::Retries=10 -qq update apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends cargo if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian') - name: Install requirements (fedora/almalinux/centos) run: | - set -euxo pipefail + set -eEuxo pipefail if ! type -P dnf &>/dev/null && type -P microdnf &>/dev/null; then # tar and gzip are required for actions/checkout on *-minimal images microdnf install -y tar gzip @@ -133,9 +133,7 @@ jobs: echo "$HOME/.cargo/bin" >>"${GITHUB_PATH}" if: startsWith(matrix.container, 'fedora') || startsWith(matrix.container, 'almalinux') || startsWith(matrix.container, 'centos') - name: Install requirements (alpine) - run: | - set -eux - apk --no-cache add bash cargo + run: apk --no-cache add bash cargo shell: sh if: startsWith(matrix.container, 'alpine') - uses: actions/checkout@v3 # TODO: actions/checkout@v4 requires glibc 2.28+ diff --git a/main.sh b/main.sh index a711a5ab..118bb984 100755 --- a/main.sh +++ b/main.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: Apache-2.0 OR MIT -set -euo pipefail +set -eEuo pipefail IFS=$'\n\t' rx() { diff --git a/tools/ci/manifest.sh b/tools/ci/manifest.sh index 388eabb4..abfdeaa8 100755 --- a/tools/ci/manifest.sh +++ b/tools/ci/manifest.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: Apache-2.0 OR MIT -set -euo pipefail +set -eEuo pipefail IFS=$'\n\t' cd "$(dirname "$0")"/../.. diff --git a/tools/ci/tool-list.sh b/tools/ci/tool-list.sh index 1fc5b275..ad1b346e 100755 --- a/tools/ci/tool-list.sh +++ b/tools/ci/tool-list.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: Apache-2.0 OR MIT -set -euo pipefail +set -eEuo pipefail IFS=$'\n\t' cd "$(dirname "$0")"/../.. diff --git a/tools/manifest.sh b/tools/manifest.sh index 06e6da0e..0fbacc75 100755 --- a/tools/manifest.sh +++ b/tools/manifest.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: Apache-2.0 OR MIT -set -euo pipefail +set -eEuo pipefail IFS=$'\n\t' cd "$(dirname "$0")"/.. diff --git a/tools/publish.sh b/tools/publish.sh index 486631c0..6bb404cb 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: Apache-2.0 OR MIT -set -euo pipefail +set -eEuo pipefail IFS=$'\n\t' cd "$(dirname "$0")"/.. diff --git a/tools/tidy.sh b/tools/tidy.sh index 262ccd36..efd20897 100755 --- a/tools/tidy.sh +++ b/tools/tidy.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: Apache-2.0 OR MIT # shellcheck disable=SC2046 -set -euo pipefail +set -eEuo pipefail IFS=$'\n\t' cd "$(dirname "$0")"/..