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

Commit 7da9e29

Browse files
author
炒饭
committed
更新脚本
1 parent 8f072ec commit 7da9e29

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
lines changed

bin/replace_weapp_vendor.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
#! /bin/sh
1+
#! /bin/bash
22

3-
cd `dirname $0`/..
3+
root_dir=$(cd `dirname $0`/.. && pwd -P)
44

5-
root_dir=$(pwd)
65
dev_tools_config_dir="$HOME/.config/微信web开发者工具"
76

87
rm -rf $dev_tools_config_dir
98

9+
cd $root_dir/dist;
10+
1011
./nw &
12+
1113
nw_pid=$!
1214

1315
echo "please wait 5s!"
@@ -27,8 +29,8 @@ if [ -d "$dev_tools_config_dir" ]; then
2729
cd $dev_tools_config_dir/WeappVendor
2830
mkdir -p s
2931
mv wc* s
30-
echo "cp $root_dir/WeappVendor/* $(pwd)"
31-
cp $root_dir/WeappVendor/* ./
32+
echo "cp $root_dir/bin/WeappVendor/* $(pwd)"
33+
cp $root_dir/bin/WeappVendor/* ./
3234
echo "Success"
3335
else
3436
echo "Fail! Please reinstall"

bin/update_nwjs.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#! /bin/bash
22
# 下载nwjs,构建项目
3-
#
4-
cd `dirname $0`/..
53

6-
root_dir=$(pwd)
4+
5+
root_dir=$(cd `dirname $0`/.. && pwd -P)
76

87
. "$root_dir/bin/build.conf"
98

10-
tmp_dir="/tmp/wcwd_xsp"
9+
tmp_dir="/tmp/wxdt_xsp"
1110

1211
nwjs_file="$tmp_dir/nwjs-v$nwjs_v.tar.gz"
1312
nwjs_dir="$tmp_dir/nwjs-sdk-v${nwjs_v}-linux-x64"

bin/update_package_nw.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#! /bin/bash
22

3-
cd `dirname $0`/..
4-
5-
root_dir=$(pwd)
3+
root_dir=$(cd `dirname $0`/.. && pwd -P)
64

75
. "$root_dir/bin/build.conf"
86

9-
tmp_dir="/tmp/wcwd_xsp"
7+
tmp_dir="/tmp/wxdt_xsp"
108
dist_dir="$root_dir/dist"
119

1210
wcwd_file="$tmp_dir/wechat_web_devtools_${wechat_v}_x64.exe"

bin/wxdt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
#! /bin/sh
2-
3-
cd `dirname $0`/..
4-
5-
root_dir=$(pwd)
1+
#! /bin/bash
62

3+
root_dir=$(cd `dirname $0`/.. && pwd -P)
4+
echo $root_dir
75
. "$root_dir/bin/build.conf"
86

97
cur_nwjs_v=""
@@ -12,7 +10,7 @@ if [ -f "$root_dir/dist/nwjs_version" ]; then
1210
cur_nwjs_v=`cat "$root_dir/dist/nwjs_version"`
1311
fi
1412

15-
if [ "$cur_nwjs_v" != $nwjs_v ]; then
13+
if [ "$cur_nwjs_v" != "$nwjs_v" ]; then
1614
echo "安装微信开发者工具对应nwjs版本:$nwjs_v"
1715
sh "$root_dir/bin/update_nwjs.sh"
1816
fi
@@ -22,6 +20,8 @@ if [ $want = "replace" ]; then
2220
sh "$root_dir/bin/replace_weapp_vendor.sh"
2321
elif [ $want = "start" ]; then
2422
`$root_dir/dist/nw`
23+
elif [ $want = "install" ]; then
24+
echo "安装完成"
2525
else
2626
echo "不支持$want操作"
2727
exit 127

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
8-
"install": "sh ./bin/wxdt.sh replace"
8+
"install": "sh bin/wxdt install"
99
},
1010
"bin": {
11-
"wxdt": "./bin/wxdt"
11+
"wxdt": "bin/wxdt"
1212
},
1313
"repository": {
1414
"type": "git",

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ linux下使用微信web开发者工具.
1717
## Installation
1818

1919
```console
20+
git clone git@github.com:cytle/wechat_web_devtools.git
21+
cd wechat_web_devtools
2022
./bin/wxdt
2123
```
2224

0 commit comments

Comments
 (0)