fix
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user