Skip to content

Commit

Permalink
PATCH: better limitations of files to add
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnysideup committed Mar 19, 2018
1 parent 9804c45 commit f16ecdc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/tasks/UpdateModules.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class UpdateModules extends BuildTask
*
* @var array
*/
private static $files_to_update = array();
private static $files_to_update = [];
/**
* e.g.
* - ClassNameForUpdatingFileA
Expand Down Expand Up @@ -66,7 +66,9 @@ public function run($request)
$files = ClassInfo::subclassesFor('AddFileToModule');
array_shift($files);
$limitedFileClasses = $this->Config()->get('files_to_update');
if ($limitedFileClasses === 'none') {
if ($limitedFileClasses === []) {
//do nothing
elseif ($limitedFileClasses === 'none') {
$files = [];
} elseif (is_array($limitedFileClasses) && count($limitedFileClasses)) {
$files = array_intersect($files, $limitedFileClasses);
Expand Down Expand Up @@ -492,7 +494,7 @@ protected function moveOldReadMe($moduleObject)
$copied = false;
foreach ($oldreadmeDestinationFiles as $file) {
$filePath = $tempDir . '/' . $moduleObject->ModuleName . '/' . $file;
Folder::makeFolder(dirname($filePath));
FileSystem::makeFolder(dirname($filePath));

if (!file_exists($filePath)) {
$copied = true;
Expand Down

0 comments on commit f16ecdc

Please sign in to comment.