mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
update the updated sources file instead of overwriting it
This commit is contained in:
parent
ec3be16aaf
commit
4dbbc8e8ac
@ -519,6 +519,11 @@ class DownloadCommand extends BaseCommand
|
||||
// Write updated sources to file
|
||||
$date = date('Y-m-d');
|
||||
$update_file = DOWNLOAD_PATH . '/.update-' . $date . '.txt';
|
||||
if (file_exists($update_file)) {
|
||||
$existing_content = file_get_contents($update_file);
|
||||
$existing_sources = array_map('trim', explode(',', $existing_content));
|
||||
$updated_sources = array_unique(array_merge($existing_sources, $updated_sources));
|
||||
}
|
||||
$content = implode(',', $updated_sources);
|
||||
file_put_contents($update_file, $content);
|
||||
logger()->debug("Updated sources written to: {$update_file}");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user