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) {