From e008b72dc9ac78e83ed93a0f55d918afa2a71a7f Mon Sep 17 00:00:00 2001 From: jay Date: Mon, 23 Oct 2023 18:28:47 +0000 Subject: [PATCH] Update basic_search_replace.yml Installs and works. TODO: Have to figure out the correct condition for the Test mode/ dry run option Make the cli output as the Success message --- basic_search_replace.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/basic_search_replace.yml b/basic_search_replace.yml index 3e405e8..b4a640a 100644 --- a/basic_search_replace.yml +++ b/basic_search_replace.yml @@ -20,6 +20,13 @@ settings: name: termReplace default: Terms to replace with tooltip: Enter the terms to replace with + - type: checkbox + caption: Dry Run + name: testMode + value: false + hideLabel: false + hidden: false + tooltip: If check Search & Replace will run in test mode onInstall: - remoteOperations: @@ -33,6 +40,7 @@ onInstall: wget --directory-prefix=/var/www/webroot/mightybox-search-replace-db https://deploy-proxy.mightybox.io/kits/search_and_replace_add-on/raw/branch/main/basic_search_replace.sh cd /var/www/webroot//mightybox-search-replace-db chmod +x basic_search_replace.sh + touch searchreplace.log #user: root #sayYes: true @@ -48,7 +56,12 @@ actions: searchReplace: - nodeGroup: cp cmd: |- - ./var/www/webroot/mightybox-search-replace-db/basic_search_replace.sh ${settings.termSearch} ${settings.termReplace} + cd /var/www/webroot/mightybox-search-replace-db/ + ./basic_search_replace.sh ${settings.termSearch} ${settings.termReplace} + if ( ${settings.testMode} == true ): + cmd: |- + cd /var/www/webroot/mightybox-search-replace-db/ + ./basic_search_replace.sh ${settings.termSearch} ${settings.termReplace} --dry-run buttons: @@ -58,4 +71,4 @@ buttons: submitButtonText: Search & Replace loadingText: confirmText: - successText: \ No newline at end of file + successText: /var/www/webroot/mightybox-search-replace-db/searchreplace.log \ No newline at end of file