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

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

问题描述

我在X code,它在归档操作结束时自动运行的脚本。它的签署和递交到建立服务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 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

推荐答案

重定向输出的地方,并在进度条会显示出来。它是在你的情况下,关闭的原因是,你问卷曲发送的数据下载到标准输出,然后自动关闭进度表,以免影响输出。

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.

所以,用>重定向在外壳或使用卷曲的 -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.

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

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