今天下载了新版本的开发者工具(v1.10 1807230)
使用命令行调用代码上传结果报错,错误如下:
换成原版本的开发者工具(v1.02 1805181)
可以上传成功
测试代码如下:
# coding: utf-8
import json
import requests
import os
def get_template_id():
appid = 'wxe1e6e01e37baf7b6'
project_dir = '/Users/ddios/dingdone/v3_pre_wxapp/_projects/wxApp/wGZMRNBr9645040/'
version = '1.0.134'
desc = 这是一个测试
r = os.system(
'echo "{\\"extEnable\\": true, \\"extAppid\\": \\"%s\\", \\"directCommit\\": true}" '
'> %s' % (appid, project_dir + '/ext.json'))
print(r)
# r = requests.get('http://127.0.0.1:57166/upload?projectpath=%s&version=%s&desc=%s' % (
# project_dir,
# version,
# desc
# ))
r = os.system(
'/Applications/wechatwebdevtools.app/Contents/Resources/app.nw/bin/cli -u %s@%s --upload-desc %s' % (
version,
project_dir,
desc
))
print(r)
if __name__ == '__main__':
get_template_id()