From 89cacb12582a71ce1d18fe263a130ce83aeaf3ab Mon Sep 17 00:00:00 2001 From: tequ Date: Mon, 24 Feb 2025 18:33:21 +0900 Subject: [PATCH] Enhance shell script error handling and debugging on GHA (#447) --- build-core.sh | 7 ++++++- build-full.sh | 7 ++++++- release-builder.sh | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/build-core.sh b/build-core.sh index d06d029bc..be73bd348 100755 --- a/build-core.sh +++ b/build-core.sh @@ -1,4 +1,9 @@ -#!/bin/bash +#!/bin/bash -u +# We use set -e and bash with -u to bail on first non zero exit code of any +# processes launched or upon any unbound variable. +# We use set -x to print commands before running them to help with +# debugging. +set -ex set -e diff --git a/build-full.sh b/build-full.sh index 14666b652..643adfb13 100755 --- a/build-full.sh +++ b/build-full.sh @@ -1,4 +1,9 @@ -#!/bin/bash +#!/bin/bash -u +# We use set -e and bash with -u to bail on first non zero exit code of any +# processes launched or upon any unbound variable. +# We use set -x to print commands before running them to help with +# debugging. +set -ex set -e diff --git a/release-builder.sh b/release-builder.sh index 7c070ac42..eb3fb6c09 100755 --- a/release-builder.sh +++ b/release-builder.sh @@ -1,4 +1,9 @@ -#!/bin/bash +#!/bin/bash -u +# We use set -e and bash with -u to bail on first non zero exit code of any +# processes launched or upon any unbound variable. +# We use set -x to print commands before running them to help with +# debugging. +set -ex set -e