From 6edb6558f8aa12057230c4d97b38b76e0577f236 Mon Sep 17 00:00:00 2001 From: sameer Date: Wed, 5 Jun 2024 16:09:21 +0530 Subject: [PATCH] Added script to determine the full path of wp --- bin/import_civicrm.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/import_civicrm.sh b/bin/import_civicrm.sh index 2860bcfb..ad4e2f75 100755 --- a/bin/import_civicrm.sh +++ b/bin/import_civicrm.sh @@ -25,7 +25,16 @@ unzip -o $ZIP_FILE cd .. +# Determine the full path to wp command +if which wp &> /dev/null; then + # macOS or Linux + WP_CLI=$(which wp) +else + # Windows + WP_CLI=$(where wp) +fi + # Use yes to automate the confirmation prompt -yes y | wp civicrm core restore --backup-dir=$EXPORT_DIR_PATH/civicrm-backup --yes +yes y | "$WP_CLI" civicrm core restore --backup-dir=$EXPORT_DIR_PATH/civicrm-backup --yes echo "Imported ${ZIP_FILE} successfully"