From 08f1685cdfe69676c3081a87a38b1be78a142256 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 15 Jun 2017 21:03:18 -0700 Subject: [PATCH] CRM-20561 - Net_SMTP - Remove example files --- tools/scripts/composer/net-smtp-fix.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/scripts/composer/net-smtp-fix.sh b/tools/scripts/composer/net-smtp-fix.sh index c01f908ade..71dd98b8ed 100755 --- a/tools/scripts/composer/net-smtp-fix.sh +++ b/tools/scripts/composer/net-smtp-fix.sh @@ -11,6 +11,20 @@ ## Replace a line in a file ## This is a bit like 'sed -i', but dumber and more cross-platform. +############################################################################## +## usage: safe_delete +function safe_delete() { + for file in "$@" ; do + if [ -z "$file" ]; then + echo "Skip: empty file name" + elif [ -e "$file" ]; then + rm -rf "$file" + fi + done +} + + +############################################################################## # Add in CiviCRM custom error message for CRM-8744. if ! grep -q 'CRM-8744' vendor/pear/net_smtp/Net/SMTP.php; then patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-patch.txt @@ -23,4 +37,6 @@ patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smt fi if grep -q '&Auth_SASL::factory' vendor/pear/net_smtp/Net/SMTP.php; then patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-ref-patch.txt -fi \ No newline at end of file +fi + +safe_delete vendor/pear/net_smtp/{examples,phpdoc.sh,tests} -- 2.25.1