Skip to content

Commit

Permalink
更新脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
炒饭 committed May 17, 2017
1 parent 8f072ec commit 7da9e29
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
12 changes: 7 additions & 5 deletions bin/replace_weapp_vendor.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#! /bin/sh
#! /bin/bash

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

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

rm -rf $dev_tools_config_dir

cd $root_dir/dist;

./nw &

nw_pid=$!

echo "please wait 5s!"
Expand All @@ -27,8 +29,8 @@ if [ -d "$dev_tools_config_dir" ]; then
cd $dev_tools_config_dir/WeappVendor
mkdir -p s
mv wc* s
echo "cp $root_dir/WeappVendor/* $(pwd)"
cp $root_dir/WeappVendor/* ./
echo "cp $root_dir/bin/WeappVendor/* $(pwd)"
cp $root_dir/bin/WeappVendor/* ./
echo "Success"
else
echo "Fail! Please reinstall"
Expand Down
7 changes: 3 additions & 4 deletions bin/update_nwjs.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#! /bin/bash
# 下载nwjs,构建项目
#
cd `dirname $0`/..

root_dir=$(pwd)

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

. "$root_dir/bin/build.conf"

tmp_dir="/tmp/wcwd_xsp"
tmp_dir="/tmp/wxdt_xsp"

nwjs_file="$tmp_dir/nwjs-v$nwjs_v.tar.gz"
nwjs_dir="$tmp_dir/nwjs-sdk-v${nwjs_v}-linux-x64"
Expand Down
6 changes: 2 additions & 4 deletions bin/update_package_nw.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#! /bin/bash

cd `dirname $0`/..

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

. "$root_dir/bin/build.conf"

tmp_dir="/tmp/wcwd_xsp"
tmp_dir="/tmp/wxdt_xsp"
dist_dir="$root_dir/dist"

wcwd_file="$tmp_dir/wechat_web_devtools_${wechat_v}_x64.exe"
Expand Down
12 changes: 6 additions & 6 deletions bin/wxdt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#! /bin/sh

cd `dirname $0`/..

root_dir=$(pwd)
#! /bin/bash

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

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

if [ "$cur_nwjs_v" != $nwjs_v ]; then
if [ "$cur_nwjs_v" != "$nwjs_v" ]; then
echo "安装微信开发者工具对应nwjs版本:$nwjs_v"
sh "$root_dir/bin/update_nwjs.sh"
fi
Expand All @@ -22,6 +20,8 @@ if [ $want = "replace" ]; then
sh "$root_dir/bin/replace_weapp_vendor.sh"
elif [ $want = "start" ]; then
`$root_dir/dist/nw`
elif [ $want = "install" ]; then
echo "安装完成"
else
echo "不支持$want操作"
exit 127
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"install": "sh ./bin/wxdt.sh replace"
"install": "sh bin/wxdt install"
},
"bin": {
"wxdt": "./bin/wxdt"
"wxdt": "bin/wxdt"
},
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ linux下使用微信web开发者工具.
## Installation

```console
git clone [email protected]:cytle/wechat_web_devtools.git
cd wechat_web_devtools
./bin/wxdt
```

Expand Down

0 comments on commit 7da9e29

Please sign in to comment.