Add coming soon page and publish toggle
This commit is contained in:
@@ -18,14 +18,8 @@ echo Modalita selezionata: DEMO PUBBLICATA
|
|||||||
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
|
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
|
||||||
"$path = '%CADDYFILE%';" ^
|
"$path = '%CADDYFILE%';" ^
|
||||||
"$content = Get-Content -Raw $path;" ^
|
"$content = Get-Content -Raw $path;" ^
|
||||||
"$pattern = '(?s)%DOMAIN% \{.*?\}';" ^
|
"$pattern = '(?ms)^%DOMAIN% \{[\s\S]*?^\}';" ^
|
||||||
"$replacement = @'" ^
|
"$replacement = '%DOMAIN% {' + [Environment]::NewLine + ' root * %LIVE_ROOT%' + [Environment]::NewLine + ' try_files {path} /index.html' + [Environment]::NewLine + ' file_server' + [Environment]::NewLine + '}';" ^
|
||||||
%DOMAIN% {
|
|
||||||
root * %LIVE_ROOT%
|
|
||||||
try_files {path} /index.html
|
|
||||||
file_server
|
|
||||||
}
|
|
||||||
'@;" ^
|
|
||||||
"$updated = [regex]::Replace($content, $pattern, $replacement);" ^
|
"$updated = [regex]::Replace($content, $pattern, $replacement);" ^
|
||||||
"Set-Content -Path $path -Value $updated -Encoding UTF8;"
|
"Set-Content -Path $path -Value $updated -Encoding UTF8;"
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
@@ -39,13 +33,8 @@ echo Modalita selezionata: COMING SOON
|
|||||||
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
|
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
|
||||||
"$path = '%CADDYFILE%';" ^
|
"$path = '%CADDYFILE%';" ^
|
||||||
"$content = Get-Content -Raw $path;" ^
|
"$content = Get-Content -Raw $path;" ^
|
||||||
"$pattern = '(?s)%DOMAIN% \{.*?\}';" ^
|
"$pattern = '(?ms)^%DOMAIN% \{[\s\S]*?^\}';" ^
|
||||||
"$replacement = @'" ^
|
"$replacement = '%DOMAIN% {' + [Environment]::NewLine + ' root * %COMING_SOON_ROOT%' + [Environment]::NewLine + ' file_server' + [Environment]::NewLine + '}';" ^
|
||||||
%DOMAIN% {
|
|
||||||
root * %COMING_SOON_ROOT%
|
|
||||||
file_server
|
|
||||||
}
|
|
||||||
'@;" ^
|
|
||||||
"$updated = [regex]::Replace($content, $pattern, $replacement);" ^
|
"$updated = [regex]::Replace($content, $pattern, $replacement);" ^
|
||||||
"Set-Content -Path $path -Value $updated -Encoding UTF8;"
|
"Set-Content -Path $path -Value $updated -Encoding UTF8;"
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
|
|||||||
Reference in New Issue
Block a user