From e2cf733d475e690af861d063203f3fefcd5de028 Mon Sep 17 00:00:00 2001 From: jay Date: Sun, 5 Nov 2023 04:37:45 +0000 Subject: [PATCH] Update basic_search_replace.yml If the terms to search and replace are the same, the operations stops and will return a warning message. Fixed the search and replace phrase issue --- basic_search_replace.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/basic_search_replace.yml b/basic_search_replace.yml index 7f6500d..f42e751 100644 --- a/basic_search_replace.yml +++ b/basic_search_replace.yml @@ -1,6 +1,6 @@ type: update name: Search Replace DB -description: Databse Search and Replace utility +description: Database Search and Replace utility logo: https://d33v4339jhl8k0.cloudfront.net/docs/assets/629d6154f38bfd3f4a4c3046/images/62ce4ffaeabe9a7235b3d220/white-300.png targetNodes: @@ -60,6 +60,10 @@ actions: - command: ${this.cmd} searchReplace: + - if ( '${settings.termSearch}' === '${settings.termReplace}' ): + stopEvent: + type: warning + message: Term to search is the same with term to replace. No action necessary. - if ( ${settings.testMode} == false ): - cmd [cp]: |- @@ -68,10 +72,7 @@ actions: wp cache flush --quiet --path=/var/www/webroot/ROOT/ rm -rf /var/www/webroot/.cache/vhosts/Jelastic/* tail -8 /var/www/webroot/mightybox-search-replace-db/searchreplace.log | head -7 - - if ( '${settings.termSearch}' === '${settings.termReplace}' ): - - cmd [cp]: |- - cd /var/www/webroot/mightybox-search-replace-db/ - echo "Term to search is the same with term to replace. No action necessary" + - if ( ${settings.testMode} == true ): - cmd [cp]: |- cd /var/www/webroot/mightybox-search-replace-db/ @@ -79,10 +80,7 @@ actions: wp cache flush --quiet --path=/var/www/webroot/ROOT/ rm -rf /var/www/webroot/.cache/vhosts/Jelastic/* tail -8 /var/www/webroot/mightybox-search-replace-db/searchreplace.log | head -7 - - if ( '${settings.termSearch}' === '${settings.termReplace}' ): - - cmd [cp]: |- - cd /var/www/webroot/mightybox-search-replace-db/ - echo "Term to search is the same with term to replace. No action necessary" +