From df632b3fe3c52cf85825c0e1e156201eb39d484e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sat, 1 Nov 2014 18:15:39 -0200 Subject: [PATCH] Tweak excludes files. --- Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php | 10 +++++----- Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php b/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php index b8b1dc6..3555ce0 100644 --- a/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php +++ b/Mage/Task/BuiltIn/Deployment/Strategy/RsyncTask.php @@ -52,7 +52,7 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware $this->checkOverrideRelease(); $excludes = $this->getExcludes(); - $excludesListFilePath = $this->getConfig()->deployment('file_containing_excludes', ''); + $excludesListFilePath = $this->getConfig()->deployment('excludes_file', ''); // If we are working with releases $deployToDirectory = $this->getConfig()->deployment('to'); @@ -122,14 +122,14 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware /** * Generates the Exclude from file for rsync - * @param string $excludesFilePath + * @param string $excludesFile * @return string */ - protected function excludesListFile($excludesFilePath) + protected function excludesListFile($excludesFile) { $excludesListFileRsync = ''; - if(!empty($excludesFilePath)) { - $excludesListFileRsync = ' --exclude-from=' . $excludesFilePath; + if(!empty($excludesFile) && file_exists($excludesFile) && is_file($excludesFile) && is_readable($excludesFile)) { + $excludesListFileRsync = ' --exclude-from=' . $excludesFile; } return $excludesListFileRsync; } diff --git a/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php b/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php index 7b9dcfe..d45ea17 100644 --- a/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php +++ b/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php @@ -46,7 +46,7 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware $this->checkOverrideRelease(); $excludes = $this->getExcludes(); - $excludesListFilePath = $this->getConfig()->deployment('file_containing_excludes', '');; + $excludesListFilePath = $this->getConfig()->deployment('excludes_file', '');; // If we are working with releases $deployToDirectory = $this->getConfig()->deployment('to'); @@ -117,15 +117,15 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware } /** - * Generates the Exclude from file for TarGz - * @param string $excludesFilePath + * Generates the Exclude from file for rsync + * @param string $excludesFile * @return string */ - protected function excludesListFile($excludesFilePath) + protected function excludesListFile($excludesFile) { $excludesListFileRsync = ''; - if(!empty($excludesFilePath)) { - $excludesListFileRsync = ' --exclude-from=' . $excludesFilePath; + if(!empty($excludesFile) && file_exists($excludesFile) && is_file($excludesFile) && is_readable($excludesFile)) { + $excludesListFileRsync = ' --exclude-from=' . $excludesFile; } return $excludesListFileRsync; }