cURL - 通知有关上传进度 [英] cURL - notify about upload progress

查看:962
本文介绍了cURL - 通知有关上传进度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode中有脚本,它在归档操作结束时自动运行。它正在签署并提交构建到TestFlight服务。问题是上传需要很多时间,我看不到任何进展。

I have script in Xcode, which runs automatically at the end of Archive operation. It's signing and submitting build to TestFlight service. The problem is that uploading takes a lot of time, and I can't see any progress.

作为通知程序,它使用苹果脚本通知程序:

As a notifier it is using apple script notifier:

notify () {
    /usr/bin/osascript -e "display notification \"$1\" with title \"Xcode\""
}
notify "Uploading to TestFlight"

cURL上传完成此处:

cURL uploading is done here:

/usr/bin/curl "http://testflightapp.com/api/builds.json" \
-F file=@"/tmp/${PRODUCT_NAME}.ipa" \
-F dsym=@"/tmp/${PRODUCT_NAME}.dSYM.zip" \
-F api_token="${API_TOKEN}" \
-F team_token="${TEAM_TOKEN}" \
-F notes="Build uploaded automatically from Xcode."

如果我可以看到类似的消息10,20等,我会很高兴...百分比

I would be happy if I can see similar messages about 10, 20, etc... percents of uploading process.

以下是完整脚本: https: //gist.github.com/ealeksandrov/5808692

推荐答案

将输出重定向到某处,进度条将显示向上。在你的情况下关闭的原因是你已经要求curl将下载的数据发送到stdout,然后它会自动关闭进度表,不会弄乱输出。

Redirect the output somewhere and the progress bar will show up. The reason it is shut off in your case is that you've asked curl to send the downloaded data to stdout and then it shuts off the progress meter automatically to not mess up the output.

因此,在shell中使用>重定向,或使用curl的 -o (小写字母o)或 -O (大写字母o)选项。

So, redirect with > in the shell or use one of curl's -o (lower case letter o) or -O (upper case letter o) options.

这篇关于cURL - 通知有关上传进度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆