Compare commits

..

5 Commits

Author SHA1 Message Date
1cf2dc3d86 fix kernel update 2024-12-18 16:52:09 +03:00
57d2f20255 some 2024-12-18 16:48:32 +03:00
5d671d03d2 some 2024-12-18 16:43:53 +03:00
d74a30f33e some 2024-12-18 16:43:32 +03:00
798c687547 fix 2024-12-18 16:38:08 +03:00
3 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "Kernel", "name": "Kernel",
"version": "0.2", "version": "0.1.1",
"author": "ITGuild", "author": "ITGuild",
"slug": "kernel", "slug": "kernel",
"type": "kernel", "type": "kernel",

View File

@ -15,7 +15,7 @@ $form->field(\itguild\forms\inputs\Select::class, "files[]", [
]) ])
->setLabel("Дополнительные файлы") ->setLabel("Дополнительные файлы")
->setOptions([ ->setOptions([
'.env.example' => '.env.example', 'env.example' => 'env.example',
'bootstrap.php' => 'bootstrap', 'bootstrap.php' => 'bootstrap',
'composer.json' => 'composer.json', 'composer.json' => 'composer.json',
]) ])

View File

@ -74,18 +74,21 @@ class KernelService
$this->files->copyKernelFolder($tmpKernelDirFull . 'kernel' , ROOT_DIR . "/kernel"); $this->files->copyKernelFolder($tmpKernelDirFull . 'kernel' , ROOT_DIR . "/kernel");
foreach ($files as $file) { foreach ($files as $file) {
Debug::prn($file); if ($file === 'bootstrap.php') {
if ($file === 'bootstrap') {
Debug::prn(123);
$this->files->recursiveRemoveDir(ROOT_DIR . '/bootstrap'); $this->files->recursiveRemoveDir(ROOT_DIR . '/bootstrap');
$this->files->copyKernelFolder($tmpKernelDirFull . 'bootstrap' , ROOT_DIR . '/bootstrap'); $this->files->copyKernelFolder($tmpKernelDirFull . 'bootstrap' , ROOT_DIR . '/bootstrap');
} }
if ($file === 'env.example') {
copy($tmpKernelDirFull . $file , ROOT_DIR . '/.' . $file);
chmod(ROOT_DIR . '/.' . $file, 0775);
continue;
}
copy($tmpKernelDirFull . $file , ROOT_DIR . '/' . $file); copy($tmpKernelDirFull . $file , ROOT_DIR . '/' . $file);
chmod(ROOT_DIR . '/' . $file, 0775);
} }
$this->files->recursiveRemoveDir($tmpKernelDirFull); $this->files->recursiveRemoveDir($tmpKernelDirFull);
unlink(ROOT_DIR . $path); unlink(ROOT_DIR . $path);
Debug::dd("update kernel success");
return true; return true;
} }