mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 04:20:49 +08:00
fix backup not include sub dir vendor
This commit is contained in:
@@ -21,13 +21,13 @@ class ToolRepository extends BaseRepository
|
||||
{
|
||||
$webRoot = base_path();
|
||||
$dirName = basename($webRoot);
|
||||
$excludes = ['vendor', 'node_modules', '.git', '.idea', '.settings', '.DS_Store'];
|
||||
$excludes = ['vendor', 'node_modules', '.git', '.idea', '.settings', '.DS_Store', '.github'];
|
||||
$baseFilename = sprintf('%s/%s.web.%s', sys_get_temp_dir(), $dirName, date('Ymd.His'));
|
||||
if (command_exists('tar') && ($method === 'tar' || $method === null)) {
|
||||
$filename = $baseFilename . ".tar.gz";
|
||||
$command = "tar";
|
||||
foreach ($excludes as $item) {
|
||||
$command .= " --exclude=$item";
|
||||
$command .= " --exclude=$dirName/$item";
|
||||
}
|
||||
$command .= sprintf(
|
||||
' -czf %s -C %s %s',
|
||||
|
||||
Reference in New Issue
Block a user