mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-30 00:47:22 +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();
|
$webRoot = base_path();
|
||||||
$dirName = basename($webRoot);
|
$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'));
|
$baseFilename = sprintf('%s/%s.web.%s', sys_get_temp_dir(), $dirName, date('Ymd.His'));
|
||||||
if (command_exists('tar') && ($method === 'tar' || $method === null)) {
|
if (command_exists('tar') && ($method === 'tar' || $method === null)) {
|
||||||
$filename = $baseFilename . ".tar.gz";
|
$filename = $baseFilename . ".tar.gz";
|
||||||
$command = "tar";
|
$command = "tar";
|
||||||
foreach ($excludes as $item) {
|
foreach ($excludes as $item) {
|
||||||
$command .= " --exclude=$item";
|
$command .= " --exclude=$dirName/$item";
|
||||||
}
|
}
|
||||||
$command .= sprintf(
|
$command .= sprintf(
|
||||||
' -czf %s -C %s %s',
|
' -czf %s -C %s %s',
|
||||||
|
|||||||
Reference in New Issue
Block a user