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

Commit dcd9f9a

Browse files
author
炒饭
committed
build.sh完成
1 parent 1660838 commit dcd9f9a

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
node_modules
2+
/.tmp
3+
/.build
4+
/dist

build.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
wechat_v="0.14.140900"
2+
nwjs_v="0.21.3"

build.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#! /bin/sh
2+
# tar wechat-dev-tools
3+
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"
11+
nwjs_download="https://dl.nwjs.io/v$nwjs_v/nwjs-sdk-v${nwjs_v}-linux-x64.tar.gz"
12+
13+
dist_wechat_dir="wechat-dev-tools"
14+
dist_wechat_package="wechat-v${wechat_v}-nwjs-v${nwjs_v}.tar.gz"
15+
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 $?
20+
fi
21+
22+
tar -xf $tmp_dir/$nwjs_file -C $tmp_dir
23+
$? -ne 0 && exit $?
24+
fi
25+
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"
31+
32+
mkdir -p $build_dir
33+
cp -l "$dist_dir/$dist_wechat_package" "$build_dir"
34+

0 commit comments

Comments
 (0)