diff --git a/docs/en/updates_checklist.md b/docs/en/updates_checklist.md index c6272ef..de36e9e 100644 --- a/docs/en/updates_checklist.md +++ b/docs/en/updates_checklist.md @@ -9,7 +9,7 @@ ## 📚 Navigation * [🔢 1. Update Version](#1-update-version) -* [🧹 2. Deleted Files (Automated)](#2-deleted-files-automated) +* [🧹 2. Deleted Files](#2-deleted-files) * [🧪 3. Pre-Release Validation](#3-pre-release-validation) * [⚙️ 4. Build Archives](#4-build-archives) * [📝 5. Changelog](#5-changelog) @@ -47,17 +47,33 @@ git push --- -## 🧹 2. Deleted Files (Automated) +## 🧹 2. Deleted Files -File cleanup is **fully automated**. No manual steps required. +Before building, generate the list of files to delete on update: -**How it works:** +```bash +make generate_deleted_files +``` -1. `make main` / `make lb` internally runs `delete_files_list` / `lb_delete_files_list` -2. This generates `migrations/deleted_files.txt` inside the archive (diff of deleted files since last tag) -3. During `php console.php update post-update`, `MigrationRunner::runFileCleanup()` reads it and deletes the listed files automatically +This runs `git diff` between `LAST_TAG` and `HEAD`, extracts deleted files under `src/`, strips the `src/` prefix, and writes the result to `src/migrations/deleted_files.txt`. -> ⚠️ **Review only:** After building, inspect `dist/migrations/deleted_files.txt` to verify no critical files are listed by mistake. +If `LAST_TAG` cannot be auto-detected (no network / no releases), pass it explicitly: + +```bash +make generate_deleted_files LAST_TAG=1.2.16 +``` + +**Review the generated file** — verify no critical files are listed by mistake: + +```bash +cat src/migrations/deleted_files.txt +``` + +After validation, `make main` / `make lb` will pack the file into the archive via `delete_files_list` / `lb_delete_files_list`. + +During `php console.php update post-update`, `MigrationRunner::runFileCleanup()` reads it and deletes the listed files automatically. + +> ⚠️ Lines starting with `#` are comments and will be ignored. You can comment out files you want to keep. --- diff --git a/docs/ru/updates_checklist.md b/docs/ru/updates_checklist.md index a45e3c2..bb347cb 100644 --- a/docs/ru/updates_checklist.md +++ b/docs/ru/updates_checklist.md @@ -9,7 +9,7 @@ ## 📚 Навигация - [🔢 1. Обновить версию](#1-обновить-версию) -- [🧹 2. Удалённые файлы (автоматически)](#2-удалённые-файлы-автоматически) +- [🧹 2. Удалённые файлы](#2-удалённые-файлы) - [🧪 3. Предрелизная проверка](#3-предрелизная-проверка) - [⚙️ 4. Сборка архивов](#4-сборка-архивов) - [📝 5. Changelog](#5-changelog) @@ -47,16 +47,33 @@ git push --- -## 🧹 2. Удалённые файлы (автоматически) +## 🧹 2. Удалённые файлы -Очистка файлов **полностью автоматизирована**. Ручных шагов не требуется. +Перед сборкой сгенерируйте список файлов для удаления при обновлении: -**Как это работает:** -1. `make main` / `make lb` внутри вызывает `delete_files_list` / `lb_delete_files_list` -2. Генерируется `migrations/deleted_files.txt` внутри архива (diff удалённых файлов с последнего тега) -3. При `php console.php update post-update` вызывается `MigrationRunner::runFileCleanup()`, который автоматически удаляет перечисленные файлы +```bash +make generate_deleted_files +``` -> ⚠️ **Только проверка:** после сборки просмотрите `dist/migrations/deleted_files.txt` — убедитесь, что в списке нет критичных файлов. +Команда запускает `git diff` между `LAST_TAG` и `HEAD`, находит удалённые файлы под `src/`, убирает префикс `src/` и записывает результат в `src/migrations/deleted_files.txt`. + +Если `LAST_TAG` не определяется автоматически (нет сети / нет релизов), передайте явно: + +```bash +make generate_deleted_files LAST_TAG=1.2.16 +``` + +**Проверьте сгенерированный файл** — убедитесь, что в списке нет критичных файлов: + +```bash +cat src/migrations/deleted_files.txt +``` + +После валидации `make main` / `make lb` упакуют файл в архив через `delete_files_list` / `lb_delete_files_list`. + +При `php console.php update post-update` вызывается `MigrationRunner::runFileCleanup()`, который автоматически удаляет перечисленные файлы. + +> ⚠️ Строки, начинающиеся с `#`, являются комментариями и будут проигнорированы. Можно закомментировать файлы, которые нужно сохранить. ---