From afb04ef056f7fe021739502e4038348df0635915 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Fri, 20 Jul 2018 22:10:05 +0200 Subject: [PATCH] don't export templates and scss files --- libs/GeneratorHelper.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/GeneratorHelper.php b/libs/GeneratorHelper.php index 263cfe1..4e87580 100755 --- a/libs/GeneratorHelper.php +++ b/libs/GeneratorHelper.php @@ -43,14 +43,22 @@ class GeneratorHelper throw new RuntimeException("Cannot copy '$source' to '$destination'"); } + $aExclDirs = array( + 'scss', + 'templates' + ); + $aExclFiles = array( + 'config.json' + ); + while (false !== ($file = readdir($dir))) { if ($file != '.' && $file != '..') { - if (is_dir($source . DIRECTORY_SEPARATOR . $file)) { + if (is_dir($source . DIRECTORY_SEPARATOR . $file) && false == in_array($file, $aExclDirs)) { static::copyRecursive( $source . DIRECTORY_SEPARATOR . $file, $destination . DIRECTORY_SEPARATOR . $file ); - } else { + } elseif (false == in_array($file, $aExclFiles)) { copy($source . DIRECTORY_SEPARATOR . $file, $destination . DIRECTORY_SEPARATOR . $file); } }