From c9ea27b9b81bf292843ef105b51cda0e72613f59 Mon Sep 17 00:00:00 2001 From: cobaltcore Date: Sun, 7 Jan 2024 17:34:12 +0100 Subject: [PATCH] Make certificate provisioning more reliable --- src/renotize.nim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/renotize.nim b/src/renotize.nim index 0e1e2d9..2c662f6 100755 --- a/src/renotize.nim +++ b/src/renotize.nim @@ -70,6 +70,15 @@ proc provision*() = echo "No .cer file found in current directory" quit(1) + var certFile = "" + for f in certFiles: + if lastPathPart(f) == "developerID_application.cer": + certFile = f + break + if certFile == "": + echo "No developerID_application.cer file found in current directory" + quit(1) + echo "This next step should be completed in the browser." echo "Press 'Enter' to open the browser and continue." discard readLine(stdin) @@ -108,13 +117,13 @@ proc provision*() = echo "Success!" echo "You can now sign your app using these two files:" echo " - private-key.pem" - echo &" - {certFiles[0]}" + echo &" - {certFile}" echo "You can also use this file to notarize your app:" echo " - app-store-key.json" let jsonData = %*{ "privateKey": readFile("private-key.pem").encode(), - "certificate": readFile(certFiles[0]).encode(), + "certificate": readFile(certFile).encode(), "appStoreKey": readFile("app-store-key.json").encode() } writeFile("renotize.json", jsonData.pretty())