Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Commit 36128cc

Browse files
author
炒饭
committed
build.sh完善
1 parent dcd9f9a commit 36128cc

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

build.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
wechat_v="0.14.140900"
2-
nwjs_v="0.21.3"
2+
nwjs_v="0.19.4"

build.sh

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
#! /bin/sh
22
# tar wechat-dev-tools
33

4-
. ./build.conf
5-
package_dir="./package.nw"
6-
tmp_dir="./.tmp"
7-
dist_dir="./dist"
8-
build_dir="./.build"
9-
nwjs_file="nwjs-v$nwjs_v.tar.gz"
10-
nwjs_dir="nwjs-sdk-v${nwjs_v}-linux-x64"
4+
cur_dir=`dirname $0`
5+
. "$cur_dir/build.conf"
6+
package_dir="$cur_dir/package.nw"
7+
tmp_dir="$cur_dir/.tmp"
8+
build_dir="$cur_dir/dist"
9+
10+
nwjs_file="$tmp_dir/nwjs-v$nwjs_v.tar.gz"
11+
nwjs_dir="$tmp_dir/nwjs-sdk-v${nwjs_v}-linux-x64"
1112
nwjs_download="https://dl.nwjs.io/v$nwjs_v/nwjs-sdk-v${nwjs_v}-linux-x64.tar.gz"
1213

13-
dist_wechat_dir="wechat-dev-tools"
14-
dist_wechat_package="wechat-v${wechat_v}-nwjs-v${nwjs_v}.tar.gz"
14+
dist_wechat_dir="$tmp_dir/wechat-dev-tools"
15+
dist_wechat_package="$tmp_dir/wechat-v${wechat_v}-nwjs-v${nwjs_v}.tar.gz"
16+
1517
mkdir -p $tmp_dir
16-
if [ ! -d "$tmp_dir/$nwjs_dir" ]; then
17-
if [ ! -f "$tmp_dir/$nwjs_file" ]; then
18-
wget "$nwjs_download" -O .tmp/$nwjs_file
19-
$? -ne 0 && exit $?
18+
if [ ! -d "$nwjs_dir" ]; then
19+
if [ ! -f "$nwjs_file" ]; then
20+
wget "$nwjs_download" -O $nwjs_file
21+
$? -ne 0 && exit "$?"
2022
fi
2123

22-
tar -xf $tmp_dir/$nwjs_file -C $tmp_dir
23-
$? -ne 0 && exit $?
24+
tar -xf $nwjs_file -C $tmp_dir
25+
$? -ne 0 && exit "$?"
2426
fi
2527

26-
rm -rf $dist_dir
27-
mkdir -p $dist_dir/$dist_wechat_dir
28-
cp -rl "$tmp_dir/$nwjs_dir"/* "$dist_dir/$dist_wechat_dir" &&
29-
cp -rl "$package_dir" "$dist_dir/$dist_wechat_dir" &&
30-
tar -zcvf "$dist_dir/$dist_wechat_package" "$dist_dir/$dist_wechat_dir"
28+
rm -rf $dist_wechat_dir
29+
mkdir -p $dist_wechat_dir
30+
cp -rl "$nwjs_dir"/* "$dist_wechat_dir" &&
31+
cp -rl "$package_dir" "$dist_wechat_dir" &&
32+
tar -zcvf "$dist_wechat_package" "$dist_wechat_dir"
3133

3234
mkdir -p $build_dir
33-
cp -l "$dist_dir/$dist_wechat_package" "$build_dir"
35+
mv -f "$dist_wechat_package" "$build_dir"
3436

0 commit comments

Comments
 (0)