mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
refactor upadater
This commit is contained in:
@ -48,6 +48,8 @@ class Updater
|
||||
File::makeDirectory($temp_path2);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
$file = $temp_path . '/upload.zip';
|
||||
|
||||
// Add content to the Zip file
|
||||
@ -77,7 +79,6 @@ class Updater
|
||||
File::deleteDirectory($temp_path);
|
||||
File::deleteDirectory($temp_path2);
|
||||
|
||||
try {
|
||||
if (!$isMinor) {
|
||||
event(new UpdateFinished($installed, $version));
|
||||
}
|
||||
@ -88,6 +89,13 @@ class Updater
|
||||
'data' => []
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
|
||||
if (File::isDirectory($temp_path)) {
|
||||
// Delete temp directory
|
||||
File::deleteDirectory($temp_path);
|
||||
File::deleteDirectory($temp_path2);
|
||||
}
|
||||
|
||||
return [
|
||||
'success' => false,
|
||||
'errors' => 'Update error',
|
||||
|
||||
Reference in New Issue
Block a user