This commit is contained in:
2025-11-23 14:17:17 +03:00
parent 448edb8671
commit 207d793b07
2 changed files with 10 additions and 7 deletions
+6 -6
View File
@@ -11,7 +11,7 @@ $nullableEntity = __getModuleEntity(__DIR__);
function copy_folder_safe($d1, $d2, $upd = true, $force = true, $exclude = [], $handler = null) {
$cm = 0;
str_replace($exclude, $exclude, $d1, $cm);
preg_filter($exclude, $exclude, $d1, -1, $cm);
if($cm){
echo 'skip ' . $d1 . PHP_EOL;
return;
@@ -39,7 +39,7 @@ function copy_folder_safe($d1, $d2, $upd = true, $force = true, $exclude = [], $
function mkdir_safe( $dir, $force ) {
if (file_exists($dir)) {
if (is_dir($dir)) return $dir;
else if (!$force) return false;
elseif (!$force) return false;
unlink($dir);
}
return (mkdir($dir, 0777, true)) ? $dir : false;
@@ -104,10 +104,10 @@ echo $newEntity->getId() . PHP_EOL;
copy_folder_safe($nullableEntity->getPath(), $newEntity->getPath(), true, true, [
'.git',
'.module.json',
'clone.php',
'readme.md',
'/\.git$/',
'/\.module\.json/',
'/clone\.php/',
'/readme\.md/',
], function ($d1, &$d2) use ($nullableEntity, $newEntity){
$lastModuleName = collect(explode('.', $newEntity->fields()->id))->last();
$lastNullableModuleName = collect(explode('.', $nullableEntity->fields()->id))->last();
+4 -1
View File
@@ -1,4 +1,7 @@
<?php
/**
* @var array $config
*/
return [
'providers' => [],
];