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