Add custom paths and ACP tab
This commit is contained in:
@@ -113,6 +113,7 @@ class SystemUpdateController extends Controller
|
||||
$append('Syncing files...');
|
||||
$usedRsync = false;
|
||||
$rsyncPath = trim((string) shell_exec('command -v rsync'));
|
||||
$protectedPaths = ['custom', 'public/custom'];
|
||||
if ($rsyncPath !== '') {
|
||||
$usedRsync = true;
|
||||
$rsync = new Process([
|
||||
@@ -122,6 +123,8 @@ class SystemUpdateController extends Controller
|
||||
'--exclude=.env',
|
||||
'--exclude=storage',
|
||||
'--exclude=public/storage',
|
||||
'--exclude=custom',
|
||||
'--exclude=public/custom',
|
||||
$sourceDir . '/',
|
||||
base_path() . '/',
|
||||
]);
|
||||
@@ -134,6 +137,15 @@ class SystemUpdateController extends Controller
|
||||
], 500);
|
||||
}
|
||||
} else {
|
||||
foreach ($protectedPaths as $path) {
|
||||
$sourcePath = $sourceDir . DIRECTORY_SEPARATOR . $path;
|
||||
if (File::exists($sourcePath)) {
|
||||
File::deleteDirectory($sourcePath);
|
||||
if (File::exists($sourcePath)) {
|
||||
File::delete($sourcePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
File::copyDirectory($sourceDir, base_path());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user