Skip to content

Commit

Permalink
自动安装最新的package.nw
Browse files Browse the repository at this point in the history
  • Loading branch information
炒饭 committed Jun 23, 2017
1 parent 02e1ad9 commit bd477d6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
2 changes: 0 additions & 2 deletions bin/build.conf

This file was deleted.

1 change: 1 addition & 0 deletions bin/nwjs_v
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.19.4
3 changes: 1 addition & 2 deletions bin/update_nwjs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 25 additions & 3 deletions bin/update_package_nw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)"
1 change: 1 addition & 0 deletions bin/wechat_v
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.18.182200
3 changes: 2 additions & 1 deletion bin/wxdt
Original file line number Diff line number Diff line change
Expand Up @@ -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=""

Expand Down

0 comments on commit bd477d6

Please sign in to comment.