From bd477d6a0e432731e55b4b4cd43584502a50aebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=82=92=E9=A5=AD?= Date: Fri, 23 Jun 2017 23:41:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=AE=89=E8=A3=85=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=9A=84package.nw?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/build.conf | 2 -- bin/nwjs_v | 1 + bin/update_nwjs.sh | 3 +-- bin/update_package_nw.sh | 28 +++++++++++++++++++++++++--- bin/wechat_v | 1 + bin/wxdt | 3 ++- 6 files changed, 30 insertions(+), 8 deletions(-) delete mode 100644 bin/build.conf create mode 100644 bin/nwjs_v create mode 100644 bin/wechat_v diff --git a/bin/build.conf b/bin/build.conf deleted file mode 100644 index 3003f04d8..000000000 --- a/bin/build.conf +++ /dev/null @@ -1,2 +0,0 @@ -wechat_v="0.17.172600" -nwjs_v="0.19.4" diff --git a/bin/nwjs_v b/bin/nwjs_v new file mode 100644 index 000000000..c0b8d590f --- /dev/null +++ b/bin/nwjs_v @@ -0,0 +1 @@ +0.19.4 diff --git a/bin/update_nwjs.sh b/bin/update_nwjs.sh index 70afced72..0786a2f81 100755 --- a/bin/update_nwjs.sh +++ b/bin/update_nwjs.sh @@ -4,8 +4,7 @@ root_dir=$(cd `dirname $0`/.. && pwd -P) -. "$root_dir/bin/build.conf" - +nwjs_v=`cat $root_dir/bin/nwjs_v` tmp_dir="/tmp/wxdt_xsp" nwjs_file="$tmp_dir/nwjs-v$nwjs_v.tar.gz" diff --git a/bin/update_package_nw.sh b/bin/update_package_nw.sh index 440aad58e..d164b56cb 100755 --- a/bin/update_package_nw.sh +++ b/bin/update_package_nw.sh @@ -6,16 +6,32 @@ root_dir=$(cd `dirname $0`/.. && pwd -P) -. "$root_dir/bin/build.conf" tmp_dir="/tmp/wxdt_xsp" dist_dir="$root_dir/dist" +cur_wechat_v=`cat $root_dir/bin/wechat_v` +echo "当前wechat_v: $cur_wechat_v" -wcwd_file="$tmp_dir/wechat_web_devtools_${wechat_v}_x64.exe" -wcwd_download="https://dldir1.qq.com/WechatWebDev/${wechat_v//./}/wechat_web_devtools_${wechat_v}_x64.exe" wcwd_package_dir="$HOME/.wine/drive_c/Program Files (x86)/Tencent/微信web开发者工具/package.nw" onlineverdor_dir="$root_dir/package.nw/app/dist/weapp/onlinevendor" +wcwd_download='https://servicewechat.com/wxa-dev-logic/download_redirect?type=x64&from=mpwiki' +wechat_v=$(http --headers $wcwd_download | grep -oP --color=never '(?<=wechat_web_devtools_)[\d\.]+(?=_x64\.exe)') + + +if [ -z "$wechat_v" ]; then + echo "下载版本为空" + exit 1 +fi + +echo "最新wechat_v: $wechat_v" + +if [ "$wechat_v" = "$cur_wechat_v" ]; then + echo "当前已经是最新版本" + exit 0 +fi + +wcwd_file="$tmp_dir/wechat_web_devtools_${wechat_v}_x64.exe" mkdir -p $tmp_dir @@ -32,7 +48,13 @@ fi wine $wcwd_file rm -rf "$root_dir/package.nw" +echo "$wcwd_package_dir" cp -r "$wcwd_package_dir" "$root_dir" # 链接wcc.exe wcsc.exe ln -f "$onlineverdor_dir/*.exe" "$root_dir/bin/WeappVendor/s" + +echo $wechat_v > $root_dir/bin/wechat_v + +echo '安装完成' +echo "wechat_v: $(cat $root_dir/bin/wechat_v)" diff --git a/bin/wechat_v b/bin/wechat_v new file mode 100644 index 000000000..1042d60cd --- /dev/null +++ b/bin/wechat_v @@ -0,0 +1 @@ +0.18.182200 diff --git a/bin/wxdt b/bin/wxdt index 53dd05fc1..b40470c34 100755 --- a/bin/wxdt +++ b/bin/wxdt @@ -2,7 +2,8 @@ root_dir=$(cd `dirname $0`/.. && pwd -P) echo $root_dir -. "$root_dir/bin/build.conf" + +nwjs_v=`cat $root_dir/bin/nwjs_v` cur_nwjs_v=""