@@ -278,20 +278,21 @@ function block_emails() {
278
278
279
279
# priority: 1. hosts.yml 2. vip 3. WP
280
280
echo -e " \033[34mSETUP EMAIL BLOCKING\033[0m"
281
- if [[ -d " $HTDOCS /wp-content/client-mu-plugins" ]]; then
282
- BLOCK_EMAIL_DIR=" $HTDOCS /wp-content/client-mu-plugins"
283
- elif [[ -d " $HTDOCS /wp-content/mu-plugins" ]]; then
284
- BLOCK_EMAIL_DIR=" $HTDOCS /wp-content/mu-plugins"
285
- fi
286
281
287
282
hosts_block_email_dir=$( shyaml get-value " $GITHUB_BRANCH .block_emails_plugin_path" < " $hosts_file " 2> /dev/null || exit 0)
288
283
289
284
if [[ -n " $hosts_block_email_dir " ]]; then
290
285
BLOCK_EMAIL_DIR=" $HTDOCS /wp-content/$hosts_block_email_dir "
291
- elif [[ -n " $BLOCK_EMAILS_PLUGIN_PATH " ]]; then
292
- BLOCK_EMAIL_DIR=" $HTDOCS /wp-content/$BLOCK_EMAILS_PLUGIN_PATH "
286
+ elif [[ -d " $HTDOCS /wp-content/client-mu-plugins" ]]; then
287
+ BLOCK_EMAIL_DIR=" $HTDOCS /wp-content/client-mu-plugins"
288
+ elif [[ -d " $HTDOCS /wp-content/mu-plugins" ]]; then
289
+ BLOCK_EMAIL_DIR=" $HTDOCS /wp-content/mu-plugins"
290
+ else
291
+ BLOCK_EMAIL_DIR=" $HTDOCS /wp-content/mu-plugins"
292
+ mkdir -p " $BLOCK_EMAIL_DIR "
293
293
fi
294
294
295
+ # remove traling slash
295
296
BLOCK_EMAIL_DIR=" ${BLOCK_EMAIL_DIR%/ } "
296
297
297
298
# using this naming convention by default to load this plugin first in mu-plugin loading phase.
@@ -309,7 +310,7 @@ function block_emails() {
309
310
310
311
if [[ -d " $BLOCK_EMAIL_DIR " ]]; then
311
312
rsync -av " /000-block-emails.php" " $BLOCK_EMAIL_PLUGIN_PATH "
312
- echo -e " \033[34mEMAIL BLOCK [Activated ]: $BLOCK_EMAIL_PLUGIN_PATH \033[0m"
313
+ echo -e " \033[34mEMAIL BLOCK [ACTIVATED ]: $BLOCK_EMAIL_PLUGIN_PATH \033[0m"
313
314
else
314
315
echo -e " \033[31mEMAIL BLOCK [PATH ERROR]: $BLOCK_EMAIL_DIR doesn't exist.\033[0m"
315
316
0 commit comments