From 070e46cf7738148fe9349b06a131f6bb4c2125d2 Mon Sep 17 00:00:00 2001 From: Shuki Vaknin Date: Wed, 11 Feb 2026 02:13:11 +0200 Subject: [PATCH] Ignore backups folder exists when uploading --- app/Filament/Jabali/Pages/DirectAdminMigration.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Filament/Jabali/Pages/DirectAdminMigration.php b/app/Filament/Jabali/Pages/DirectAdminMigration.php index f4be28f..32650c4 100644 --- a/app/Filament/Jabali/Pages/DirectAdminMigration.php +++ b/app/Filament/Jabali/Pages/DirectAdminMigration.php @@ -260,8 +260,14 @@ class DirectAdminMigration extends Page implements HasActions, HasForms ])); } - // Ensure backups folder exists - $this->getAgent()->fileMkdir($user->username, 'backups'); + // Ensure backups folder exists (mkdir will error if it already exists). + try { + $this->getAgent()->fileMkdir($user->username, 'backups'); + } catch (Exception $e) { + if ($e->getMessage() !== 'Path already exists') { + throw $e; + } + } // Stage into the agent-allowed temp dir, then let the agent move it. $tmpDir = '/tmp/jabali-uploads';