Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/gh-action-sdk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Lipnitskiy <ilya.lipnitskiy@gmail.com>2021-02-19 07:13:17 +0300
committerPaul Spooren <mail@aparcar.org>2021-02-20 09:35:41 +0300
commit89fdaa4ef07941ec77449275c785cb69b78a1dd0 (patch)
tree37f855cf50f58ca6ec0720830625650cadf32671
parentb385dcad35c0dd7d1359ec4e3d391e1657608b98 (diff)
clean up and print error on refresh fail
set -e causes bash to exit right away on cmd failure. So run the command inside the if statement to get a chance to clean up and print an error message. https://github.com/koalaman/shellcheck/wiki/SC2181 https://superuser.com/a/940542 https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#The-Set-Builtin Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
-rwxr-xr-xentrypoint.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/entrypoint.sh b/entrypoint.sh
index 95f266c..471863a 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -72,8 +72,7 @@ else
"package/$PKG/refresh" V=s || \
exit $?
- git -C "$PATCHES_DIR" diff --quiet -- .
- if [ $? -ne 0 ]; then
+ if ! git -C "$PATCHES_DIR" diff --quiet -- .; then
echo "Dirty patches detected, please refresh and review the diff"
git -C "$PATCHES_DIR" checkout -- .
exit 1