From c9a009422033f908961b78cdc6b749212b6ad266 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 13 Dec 2023 12:39:29 +1100 Subject: [PATCH] chore: use safer drush cr status check for version --- services/api/src/resources/task/resolvers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/api/src/resources/task/resolvers.ts b/services/api/src/resources/task/resolvers.ts index 295f8f16ec..b5949e180a 100644 --- a/services/api/src/resources/task/resolvers.ts +++ b/services/api/src/resources/task/resolvers.ts @@ -595,11 +595,11 @@ export const taskDrushCacheClear: ResolverFn = async ( }); const command = - 'drupal_version=$(drush status drupal-version --format=list) && \ + 'drupal_version=$(drush status | grep -i "drupal version" | awk \'{print $NF}\') && \ if [ ${drupal_version%.*} == "7" ]; then \ if drush cc all; then echo "drush cc all complete"; else exit $?; fi; \ elif [ ${drupal_version%.*.*} -ge "8" ] ; then \ - if drush cr; then echo "drush cr complete"; else exit $?; fi; \ + if drush cr -y; then echo "drush cache:rebuild complete"; else exit $?; fi; \ else \ echo "could not clear cache for found Drupal Version ${drupal_version}"; \ exit 1; \