diff --git a/Makefile b/Makefile index 894c2d6..39de61e 100644 --- a/Makefile +++ b/Makefile @@ -521,28 +521,7 @@ release-local: checksum ifeq ($(OS),Windows_NT) wiki-update: $(info >>> Синхронизация wiki в Gitea...) - if (-Not (Test-Path 'wiki')) { throw 'Папка wiki/ не найдена.' } - $$origin = git remote get-url origin - if (-not $$origin) { throw 'Не найден remote origin.' } - if ($$origin -match '\.git$$') { $$wikiUrl = $$origin -replace '\.git$$', '.wiki.git' } else { $$wikiUrl = "$$origin.wiki.git" } - $$tmp = '$(BUILD_DIR)\\.wiki-sync' - Remove-Item -Recurse -Force $$tmp -ErrorAction SilentlyContinue - New-Item -ItemType Directory -Force '$(BUILD_DIR)' | Out-Null - git clone --depth 1 $$wikiUrl $$tmp - robocopy wiki $$tmp /MIR /XD .git | Out-Null; if ($$LASTEXITCODE -gt 7) { throw 'Ошибка robocopy при синхронизации wiki.' } - Push-Location $$tmp - git add -A - if (git diff --cached --quiet) { - $(info >>> Изменений в wiki нет.) - Pop-Location - } else { - git config user.name "wiki-sync-bot" - git config user.email "wiki-sync@local" - git commit -m "docs(wiki): sync from main repo" - git push origin HEAD - Pop-Location - $(info >>> Wiki успешно обновлена.) - } + @$$ErrorActionPreference = "Stop"; if (-Not (Test-Path "wiki")) { throw "wiki/ folder not found." }; $$origin = git remote get-url origin; if (-not $$origin) { throw "origin remote not found." }; if ($$origin -match "\.git$$") { $$wikiUrl = $$origin -replace "\.git$$", ".wiki.git" } else { $$wikiUrl = "$$origin.wiki.git" }; $$tmp = "$(BUILD_DIR)\\.wiki-sync"; Remove-Item -Recurse -Force $$tmp -ErrorAction SilentlyContinue; New-Item -ItemType Directory -Force "$(BUILD_DIR)" | Out-Null; git clone --depth 1 $$wikiUrl $$tmp; robocopy wiki $$tmp /MIR /XD .git | Out-Null; if ($$LASTEXITCODE -gt 7) { throw "robocopy failed while syncing wiki." }; Push-Location $$tmp; git add -A; git diff --cached --quiet; if ($$LASTEXITCODE -eq 0) { Write-Host "No wiki changes."; Pop-Location; exit 0 }; git config user.name "wiki-sync-bot"; git config user.email "wiki-sync@local"; git commit -m "docs(wiki): sync from main repo"; git push origin HEAD; Pop-Location; Write-Host "Wiki synced successfully." else wiki-update: $(info >>> Синхронизация wiki в Gitea...) diff --git a/build/.wiki-sync b/build/.wiki-sync new file mode 160000 index 0000000..556b793 --- /dev/null +++ b/build/.wiki-sync @@ -0,0 +1 @@ +Subproject commit 556b793e26d35ac8e8874abd0a24e12cf3ba61df