mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:50:46 +08:00
fix(setup): escape DO $$ in PowerShell heredoc
Use escaped $$ delimiters inside the SQL block so PowerShell does not treat them as interpolation and break init_pg on first-run setup. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
46745b372f
commit
a0264e5e94
1 changed files with 2 additions and 2 deletions
|
|
@ -45,7 +45,7 @@ $env:PGPASSWORD = $SuperPassword
|
|||
try {
|
||||
Write-Host "==> Ensuring role '$NetxUser'"
|
||||
$roleSql = @"
|
||||
DO $$
|
||||
DO `$\$
|
||||
BEGIN
|
||||
IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '$NetxUser') THEN
|
||||
CREATE ROLE $NetxUser LOGIN PASSWORD '$NetxPassword';
|
||||
|
|
@ -53,7 +53,7 @@ BEGIN
|
|||
ALTER ROLE $NetxUser WITH LOGIN PASSWORD '$NetxPassword';
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
`$\$;
|
||||
"@
|
||||
Invoke-Psql -Database "postgres" -Sql $roleSql
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue