From bd465695918571fd18efdaaf492d022c03bb1d7d Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 3 Oct 2023 12:58:59 -0600 Subject: [PATCH] check for updates before apply --- bin/behat-prepare.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/behat-prepare.sh b/bin/behat-prepare.sh index 35f4ab0..3c43976 100755 --- a/bin/behat-prepare.sh +++ b/bin/behat-prepare.sh @@ -25,11 +25,16 @@ fi set -ex ### -# Apply any outstanding upstream updates. +# Check for and apply any outstanding upstream updates. # This never happens manually, so we might as well do it in automation before we run tests. ### terminus connection:set $TERMINUS_SITE.dev git -terminus upstream:updates:apply $TERMINUS_SITE.dev --accept-upstream +updates=$(terminus upstream:updates:list "$TERMINUS_SITE.dev") +if echo "$updates" | grep -q "There are no available updates for this site."; then + echo "No upstream updates to apply." +else + terminus upstream:updates:apply "$TERMINUS_SITE.dev" --accept-upstream +fi ### # Create a new environment for this particular test run.