I am using the below script for publishing the ipa to appcenter.
ipaPath=<PATH TO MY IPA FILE>
echo "Found ipa at $ipaPath"
if [[ -z ${ipaPath} ]]
then
echo "No ipas were found, skip publishing to App Center"
else
appcenter login
appcenter distribute release \
--group Collaborators \
--file "${ipaPath}" \
--release-notes 'App submission' \
--app <username_or_organization>/<application_identifier> \
--quiet
fi
I need to exit if the login is failed and don't want to run the distribute command. how to check the login status and handle the error?
You could use command substitution to capture the result of
appcenter login
into a variable, then search the variable contents for a specific string (or lack of). For example: