From fd112b23f34f2370aa043c7d3e039d750aad2293 Mon Sep 17 00:00:00 2001 From: rapaf Date: Fri, 18 Sep 2026 19:37:55 +0200 Subject: [PATCH] =?UTF-8?q?Wdra=C5=BCaj=20Cloudflare=20przed=20pushem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- hooks/pre-push | 7 +++++++ install-cloudflare-hook.ps1 | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 hooks/pre-push diff --git a/hooks/pre-push b/hooks/pre-push new file mode 100644 index 0000000..439c9a8 --- /dev/null +++ b/hooks/pre-push @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +repo_root=$(git rev-parse --show-toplevel) +echo "Cloudflare Pages: wdrazanie przed push..." +powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$repo_root/deploy-cloudflare.ps1" +echo "Cloudflare Pages: wdrozenie zakonczone, kontynuuje push." diff --git a/install-cloudflare-hook.ps1 b/install-cloudflare-hook.ps1 index 14dd0b1..4d4d117 100644 --- a/install-cloudflare-hook.ps1 +++ b/install-cloudflare-hook.ps1 @@ -1,8 +1,8 @@ $ErrorActionPreference = "Stop" $root = Split-Path -Parent $MyInvocation.MyCommand.Path $hooks = Join-Path $root ".git\hooks" -$source = Join-Path $root "hooks\post-push" -$target = Join-Path $hooks "post-push" +$source = Join-Path $root "hooks\pre-push" +$target = Join-Path $hooks "pre-push" if (-not (Test-Path $hooks)) { throw "Nie znaleziono folderu .git/hooks. Uruchom skrypt w katalogu repozytorium." @@ -11,6 +11,7 @@ if (-not (Test-Path $hooks)) { git -C $root config --local core.hooksPath "$hooks" Copy-Item $source $target -Force Remove-Item (Join-Path $hooks "post-push.cmd") -Force -ErrorAction SilentlyContinue +Remove-Item (Join-Path $hooks "post-push") -Force -ErrorAction SilentlyContinue $bash = "C:\Program Files\Git\bin\bash.exe" if (Test-Path $bash) {