From 59cbe3e428f1b270fba5f0c9ed7d63331547affc Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Wed, 17 Jul 2024 07:03:07 +1000 Subject: [PATCH] db migrations - remove comments before parsing secrets (#4519) --- dev/migrate.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/migrate.ps1 b/dev/migrate.ps1 index 03890b555..ee78e90d3 100755 --- a/dev/migrate.ps1 +++ b/dev/migrate.ps1 @@ -27,7 +27,9 @@ if ($all -or $postgres -or $mysql -or $sqlite) { if ($all -or $mssql) { function Get-UserSecrets { - return dotnet user-secrets list --json --project ../src/Api | ConvertFrom-Json + # The dotnet cli command sometimes adds //BEGIN and //END comments to the output, Where-Object removes comments + # to ensure a valid json + return dotnet user-secrets list --json --project ../src/Api | Where-Object { $_ -notmatch "^//" } | ConvertFrom-Json } if ($selfhost) {