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

Commit e6fb66e

Browse files
author
炒饭
committed
去除打包等其他,使用wxdt启动
1 parent 5316141 commit e6fb66e

File tree

10 files changed

+96
-99
lines changed

10 files changed

+96
-99
lines changed
File renamed without changes.
File renamed without changes.

bin/pack.sh

Lines changed: 0 additions & 68 deletions
This file was deleted.

scripts/replace_weapp_vendor.sh renamed to bin/replace_weapp_vendor.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cd `dirname $0`/..
44

5-
cur_dir=$(pwd)
5+
root_dir=$(pwd)
66
dev_tools_config_dir="$HOME/.config/微信web开发者工具"
77

88
rm -rf $dev_tools_config_dir
@@ -27,13 +27,9 @@ if [ -d "$dev_tools_config_dir" ]; then
2727
cd $dev_tools_config_dir/WeappVendor
2828
mkdir -p s
2929
mv wc* s
30-
echo "cp $cur_dir/scripts/WeappVendor/* $(pwd)"
31-
cp $cur_dir/scripts/WeappVendor/* ./
32-
echo "install success!"
30+
echo "cp $root_dir/WeappVendor/* $(pwd)"
31+
cp $root_dir/WeappVendor/* ./
32+
echo "Success"
3333
else
34-
echo "install faile! please reinstll"
34+
echo "Fail! Please reinstall"
3535
fi
36-
37-
38-
39-

bin/update_nwjs.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#! /bin/bash
2+
# 下载nwjs,构建项目
3+
#
4+
cd `dirname $0`/..
5+
6+
root_dir=$(pwd)
7+
8+
. "$root_dir/bin/build.conf"
9+
10+
tmp_dir="/tmp/wcwd_xsp"
11+
12+
nwjs_file="$tmp_dir/nwjs-v$nwjs_v.tar.gz"
13+
nwjs_dir="$tmp_dir/nwjs-sdk-v${nwjs_v}-linux-x64"
14+
nwjs_download="https://dl.nwjs.io/v$nwjs_v/nwjs-sdk-v${nwjs_v}-linux-x64.tar.gz"
15+
16+
dist_dir="$root_dir/dist"
17+
18+
mkdir -p $tmp_dir
19+
if [ ! -d "$nwjs_dir" ]; then
20+
if [ ! -f "$nwjs_file" ]; then
21+
echo "================================="
22+
echo "[注意]需要下载nwjs.请耐心等待下载完成"
23+
echo "$nwjs_download"
24+
echo "================================="
25+
wget "$nwjs_download" -O "$nwjs_file"
26+
fi
27+
28+
tar -xf "$nwjs_file" -C $tmp_dir
29+
cd "$nwjs_dir/locales" || exit "$?"
30+
# 移除其他语言
31+
ls -I "zh*" -I "en*" | xargs rm
32+
cd "$root_dir"
33+
fi
34+
35+
36+
rm -rf "$dist_dir"
37+
mkdir -p "$dist_dir"
38+
39+
cp -r "$nwjs_dir"/* "$dist_dir"
40+
ln -sf "../package.nw" "$dist_dir/package.nw"
41+
42+
echo "$nwjs_v" > "$dist_dir/nwjs_version"
43+
44+
echo "update nwjs success"

bin/update_package_nw.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ root_dir=$(pwd)
66

77
. "$root_dir/bin/build.conf"
88

9-
tmp_dir="$root_dir/.tmp"
9+
tmp_dir="/tmp/wcwd_xsp"
1010
dist_dir="$root_dir/dist"
1111

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

bin/wxdt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
#! /bin/sh
22

3-
$("`dirname $0`/../dist/nw")
3+
cd `dirname $0`/..
44

5+
root_dir=$(pwd)
6+
7+
. "$root_dir/bin/build.conf"
8+
9+
cur_nwjs_v=""
10+
11+
if [ -f "$root_dir/dist/nwjs_version" ]; then
12+
cur_nwjs_v=`cat "$root_dir/dist/nwjs_version"`
13+
fi
14+
15+
if [ "$cur_nwjs_v" != $nwjs_v ]; then
16+
echo "安装微信开发者工具对应nwjs版本:$nwjs_v"
17+
sh "$root_dir/bin/update_nwjs.sh"
18+
fi
19+
20+
want=${1:-"start"}
21+
if [ $want = "replace" ]; then
22+
sh "$root_dir/bin/replace_weapp_vendor.sh"
23+
elif [ $want = "start" ]; then
24+
`$root_dir/dist/nw`
25+
else
26+
echo "不支持$want操作"
27+
exit 127
28+
fi

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wxdt",
3-
"version": "0.0.2",
3+
"version": "v0.17.170900",
44
"description": "凌晨三点终于搞定了linux下开发者工具的使用,已经完美使用,之后上完整安装教程和npm包.",
55
"main": "index.js",
66
"scripts": {

readme.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
linux下使用微信web开发者工具.
44

5-
![wx-dev-tools v-0.15.152900](https://img.shields.io/badge/wx_dev_tools-0.15.152900-green.svg)
5+
![wx-dev-tools v-0.17.170900](https://img.shields.io/badge/wx_dev_tools-0.17.170900-green.svg)
66
![nw.js v-0.19.4](https://img.shields.io/badge/nw.js-v0.19.4-blue.svg)
77

88
## Description
@@ -12,14 +12,12 @@ linux下使用微信web开发者工具.
1212

1313
- 2017/03/28 更新:微信小程序升级到0.15.152800
1414
- 2017/03/30 更新:微信小程序升级到0.15.152900
15+
- 2017/05/18 更新:微信小程序升级到0.17.170900
1516

1617
## Installation
1718

18-
### 如果不需要小程序开发
1919
```console
20-
git clone git@github.com:cytle/wechat_web_devtools.git
21-
cd wechat_web_devtools && sh ./bin/pack.sh build
22-
cd dist && ./nw
20+
./bin/wxdt
2321
```
2422

2523
### 需要小程序开发
@@ -34,15 +32,28 @@ sudo apt install wine
3432
WINEARCH=win32 WINEPREFIX=~/.wine32 winecfg
3533
```
3634

37-
3. 安装
35+
3. 替换WeappVendor
3836
```console
39-
git clone git@github.com:cytle/wechat_web_devtools.git
40-
cd wechat_web_devtools && sh ./bin/pack.sh install
37+
./bin/wxdt replace
4138
```
4239

4340
4. 启动
4441
```console
45-
cd dist && ./nw
42+
./bin/wxdt
43+
```
44+
45+
## 更新
46+
47+
直接pull就好了
48+
49+
```console
50+
git pull origin
51+
```
52+
53+
如果wcc和wcsc编译有问题,执行以下,让工具重新生成wcc和wcsc,**会删除开发者工具配置文件,所有工程和登录信息会消失**
54+
55+
```console
56+
./bin/wxdt replace
4657
```
4758

4859
## 截图

scripts/wechat-web-devtools.desktop

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)