Skip to content

Commit fcd61ef

Browse files
committed
Merge pull request webfrogs#8 from woooha/update-app-info-after-uploading
Update app info after uploading.
2 parents ac147ef + 84c5b71 commit fcd61ef

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

ipa-publish-fir

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
# 修改人:Shannon Chou
2828
# 修改内容:在原ipa-publish 的基础上改为ipa-publish-fir,用于将app 发布到fir.im上测试
2929
#--------------------------------------------
30-
3130
#须配置内容 start
3231

3332
#以下是邮箱的相关设置,jiecao.fm 提供了一个可以直接使用的邮箱账号,请不要去更改邮箱密码,以便他人使用
@@ -134,6 +133,8 @@ target_name=$(/usr/libexec/PlistBuddy -c "print CFBundleName" ${app_infoplist_pa
134133
#取CFBundleDisplayName
135134
display_name=$(/usr/libexec/PlistBuddy -c "print CFBundleDisplayName" ${app_infoplist_path})
136135

136+
echo "App $display_name版本号为: $bundleShortVersion, 构建号为: $bundleVersion."
137+
137138
#删除临时文件夹
138139
cd ..
139140
rm -rf ${tmpfoldername}
@@ -179,7 +180,9 @@ echo $fir_publish_url
179180
fir_publish_key=`ruby -e "require 'json'; iJson = JSON.parse '${response}'; puts iJson['bundle']['pkg']['key']"`
180181
fir_publish_token=`ruby -e "require 'json'; iJson = JSON.parse '${response}'; puts iJson['bundle']['pkg']['token']"`
181182
realShort=`ruby -e "require 'json'; iJson = JSON.parse '${response}'; puts iJson['short']"`
182-
echo $realShort
183+
#第一次请求得到的 Appid, 用来最后更新 App 的信息.
184+
fir_app_id=`ruby -e "require 'json'; iJson = JSON.parse '${response}'; puts iJson['id']"`
185+
183186

184187
#上传ipa包,并获取最终的url short name
185188
echo "Uploading the ipa file..."
@@ -190,8 +193,9 @@ exit 1
190193
fi
191194

192195
echo "Finishing uploading and filling in the app information..."
193-
# response=`curl -L "$fir_finish_url?appid=$bundleIdentifier&short=$fir_publish_short_name&version=$bundleShortVersion($bundleVersion)&name=${ipa_name}_v${bundleShortVersion}&changelog=$change_msg$git_log"`
194-
# realShort=`ruby -e "require 'json'; iJson = JSON.parse '${response}'; puts iJson['short']"`
196+
echo "Updateing app info."
197+
response=`curl -X PUT -H "Content-Length: 0" -L "http://fir.im/api/v2/app/$fir_app_id?token=$fir_token&version=$bundleVersion&versionShort=$bundleShortVersion" -v`
198+
realShort=`ruby -e "require 'json'; iJson = JSON.parse '${response}'; puts iJson['short']"`
195199

196200
#拼接完整的下载url,并在浏览器中打开
197201
pulish_url=$fir_domain/$realShort

0 commit comments

Comments
 (0)