fix(vikon): create target directories before rename in syncFiles

This commit is contained in:
F4ilji
2026-07-04 19:29:50 +05:00
parent 0097a803b4
commit e0cf362433
@@ -60,6 +60,7 @@ class UpdateCoreAction
$extractedDirs = File::directories($tempPath); $extractedDirs = File::directories($tempPath);
$syncSource = $extractedDirs[0] ?? $tempPath; $syncSource = $extractedDirs[0] ?? $tempPath;
File::makeDirectory($modulePath, 0755, true, true);
$this->syncFiles($syncSource, $modulePath); $this->syncFiles($syncSource, $modulePath);
File::put($modulePath . '/.vikon', date('Y-m-d H:i:s')); File::put($modulePath . '/.vikon', date('Y-m-d H:i:s'));
File::deleteDirectory($tempPath); File::deleteDirectory($tempPath);
@@ -111,6 +112,8 @@ class UpdateCoreAction
private function syncFiles(string $source, string $target): void private function syncFiles(string $source, string $target): void
{ {
File::makeDirectory($target, 0755, true, true);
foreach (File::files($source) as $file) { foreach (File::files($source) as $file) {
$name = $file->getFilename(); $name = $file->getFilename();
$targetPath = $target . '/' . $name; $targetPath = $target . '/' . $name;