From 08a6b94d4781445e3bd3306cb95dbd7a02188624 Mon Sep 17 00:00:00 2001 From: Michiel Hazelhof Date: Tue, 12 Aug 2025 19:27:37 +0200 Subject: [PATCH] Migrate cert.cert if exists --- build.ps1 | 9 +++++++-- build.sh | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index a48cfcd..87aa351 100644 --- a/build.ps1 +++ b/build.ps1 @@ -7,7 +7,7 @@ $tempdirectory = "$pwd\temp" $components = "Api","Identity" # delete old directories / files if applicable -if (Test-Path "$tempdirectory") { +if (Test-Path "$tempdirectory" -PathType Container) { Remove-Item "$tempdirectory" -Recurse -Force } @@ -23,8 +23,13 @@ if (Test-Path -Path "$pwd\src\bitBetter\cert.cer" -PathType Leaf) { Remove-Item "$pwd\src\bitBetter\cert.cer" -Force } +if (Test-Path "$pwd\.keys\cert.cert" -PathType Leaf) { + Rename-Item -Path "$pwd\.keys\cert.cert" -NewName "$pwd\.keys\cert.cer" +} + + # generate keys if none are available -if (!(Test-Path "$pwd\.keys")) { +if (!(Test-Path "$pwd\.keys" -PathType Container)) { .\generateKeys.ps1 } diff --git a/build.sh b/build.sh index 1938e79..3f43b92 100755 --- a/build.sh +++ b/build.sh @@ -24,6 +24,10 @@ if [ -f "$PWD/src/bitBetter/cert.cer" ]; then rm -f "$PWD/src/bitBetter/cert.cer" fi +if [ -f "$PWD/.keys/cert.cert" ]; then + mv "$PWD/.keys/cert.cert" "$PWD/.keys/cert.cer" +fi + # generate keys if none are available if [ ! -d "$PWD/.keys" ]; then ./generateKeys.sh