From 051b9c2102abe5f03d5855b91139d8c81c65f1a7 Mon Sep 17 00:00:00 2001 From: allebonvi Date: Sat, 4 Apr 2026 18:57:18 +0200 Subject: [PATCH] Add coming soon page and publish toggle --- publish_demo.bat | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/publish_demo.bat b/publish_demo.bat index 8f9dec8..addff83 100644 --- a/publish_demo.bat +++ b/publish_demo.bat @@ -18,14 +18,8 @@ echo Modalita selezionata: DEMO PUBBLICATA powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$path = '%CADDYFILE%';" ^ "$content = Get-Content -Raw $path;" ^ - "$pattern = '(?s)%DOMAIN% \{.*?\}';" ^ - "$replacement = @'" ^ -%DOMAIN% { - root * %LIVE_ROOT% - try_files {path} /index.html - file_server -} -'@;" ^ + "$pattern = '(?ms)^%DOMAIN% \{[\s\S]*?^\}';" ^ + "$replacement = '%DOMAIN% {' + [Environment]::NewLine + ' root * %LIVE_ROOT%' + [Environment]::NewLine + ' try_files {path} /index.html' + [Environment]::NewLine + ' file_server' + [Environment]::NewLine + '}';" ^ "$updated = [regex]::Replace($content, $pattern, $replacement);" ^ "Set-Content -Path $path -Value $updated -Encoding UTF8;" if errorlevel 1 ( @@ -39,13 +33,8 @@ echo Modalita selezionata: COMING SOON powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$path = '%CADDYFILE%';" ^ "$content = Get-Content -Raw $path;" ^ - "$pattern = '(?s)%DOMAIN% \{.*?\}';" ^ - "$replacement = @'" ^ -%DOMAIN% { - root * %COMING_SOON_ROOT% - file_server -} -'@;" ^ + "$pattern = '(?ms)^%DOMAIN% \{[\s\S]*?^\}';" ^ + "$replacement = '%DOMAIN% {' + [Environment]::NewLine + ' root * %COMING_SOON_ROOT%' + [Environment]::NewLine + ' file_server' + [Environment]::NewLine + '}';" ^ "$updated = [regex]::Replace($content, $pattern, $replacement);" ^ "Set-Content -Path $path -Value $updated -Encoding UTF8;" if errorlevel 1 (