我使用下面的脚本将ipa发布到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如果登录失败并且不想运行分发命令,则需要退出。如何检查登录状态并处理错误?
发布于 2020-09-23 23:09:26
您可以使用command substitution将appcenter login的结果捕获到一个变量中,然后在变量内容中搜索特定字符串(或缺少的字符串)。例如:
reply="$(appcenter login --token ${token})"
if [[ $reply == *"Error"* ]]; then
echo "A problem occurred! ${reply}"
else
appcenter distribute release
...
fihttps://stackoverflow.com/questions/63667511
复制相似问题