Skip copying vendor if error occurred when upgrading

This commit is contained in:
printempw 2017-08-05 16:00:14 +08:00
parent 4bf1058c46
commit fe721bd833

View File

@ -177,6 +177,15 @@ class UpdateController extends Controller
}
$zip->close();
try {
File::copyDirectory("$extract_dir/vendor", base_path('vendor'));
} catch (\Exception $e) {
Log::error('[Extracter] Unable to extract vendors', [$e]);
// Skip copying vendor
File::deleteDirectory("$extract_dir/vendor");
}
try {
File::copyDirectory($extract_dir, base_path());