Wdrażaj Cloudflare przed pushem
Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -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."
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
$root = Split-Path -Parent $MyInvocation.MyCommand.Path
|
$root = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||||
$hooks = Join-Path $root ".git\hooks"
|
$hooks = Join-Path $root ".git\hooks"
|
||||||
$source = Join-Path $root "hooks\post-push"
|
$source = Join-Path $root "hooks\pre-push"
|
||||||
$target = Join-Path $hooks "post-push"
|
$target = Join-Path $hooks "pre-push"
|
||||||
|
|
||||||
if (-not (Test-Path $hooks)) {
|
if (-not (Test-Path $hooks)) {
|
||||||
throw "Nie znaleziono folderu .git/hooks. Uruchom skrypt w katalogu repozytorium."
|
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"
|
git -C $root config --local core.hooksPath "$hooks"
|
||||||
Copy-Item $source $target -Force
|
Copy-Item $source $target -Force
|
||||||
Remove-Item (Join-Path $hooks "post-push.cmd") -Force -ErrorAction SilentlyContinue
|
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"
|
$bash = "C:\Program Files\Git\bin\bash.exe"
|
||||||
if (Test-Path $bash) {
|
if (Test-Path $bash) {
|
||||||
|
|||||||
Reference in New Issue
Block a user