sign and notarize only when options available

This commit is contained in:
Alessandro Muntoni 2023-06-07 15:57:48 +02:00
parent d87e091195
commit 8ff4653334
2 changed files with 15 additions and 11 deletions

View File

@ -8,8 +8,8 @@ PACKAGES_PATH=$SCRIPTS_PATH/../../packages
SIGN=false
NOTARIZE=false
CERT_ID=""
NOT_USER=""
NOT_PASSWORD=""
NOTAR_USER=""
NOTAR_PASSWORD=""
#checking for parameters
for i in "$@"
@ -28,17 +28,21 @@ case $i in
shift # past argument=value
;;
-ci=*|--cert_id=*)
SIGN=true
CERT_ID="${i#*=}"
if [ -n "$CERT_ID" ]; then
SIGN=true
fi
shift # past argument=value
;;
-nu=*|--notarization_user=*)
NOTARIZE=true
NOT_USER="${i#*=}"
if [ -n "$NOT_USER" ]; then
NOTARIZE=true
fi
shift # past argument=value
;;
-np=*|--notarization_password=*)
NOT_PASSWORD="${i#*=}"
NOTAR_PASSWORD="${i#*=}"
shift # past argument=value
;;
*)
@ -58,7 +62,7 @@ if [ "$SIGN" = true ] ; then
fi
if [ "$NOTARIZE" = true ] ; then
bash $SCRIPTS_PATH/internal/2c_notarize_appbundle.sh -i=$INSTALL_PATH -nu=$NOT_USER -np=$NOT_PASSWORD
bash $SCRIPTS_PATH/internal/2c_notarize_appbundle.sh -i=$INSTALL_PATH -nu=$NOT_USER -np=$NOTAR_PASSWORD
echo "======= AppBundle Notarized ======="
fi

View File

@ -3,8 +3,8 @@
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/..
INSTALL_PATH=$SCRIPTS_PATH/../../install
NOT_USER=""
NOT_PASSWORD=""
NOTAR_USER=""
NOTAR_PASSWORD=""
#checking for parameters
for i in "$@"
@ -15,11 +15,11 @@ case $i in
shift # past argument=value
;;
-nu=*|--notarization_user=*)
NOT_USER="${i#*=}"
NOTAR_USER="${i#*=}"
shift # past argument=value
;;
-np=*|--notarization_password=*)
NOT_PASSWORD="${i#*=}"
NOTAR_PASSWORD="${i#*=}"
shift # past argument=value
;;
*)
@ -28,7 +28,7 @@ case $i in
esac
done
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$NOT_USER" --password "$NOT_PASSWORD"
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$NOTAR_USER" --password "$NOTAR_PASSWORD"
ditto -c -k --keepParent "$INSTALL_PATH/meshlab.app" "$INSTALL_PATH/notarization.zip"