diff --git a/bin/pack.sh b/bin/pack.sh index b212a989c..704e74281 100755 --- a/bin/pack.sh +++ b/bin/pack.sh @@ -1,7 +1,9 @@ #! /bin/sh # tar wechat-dev-tools -param1=$1 +param1=${1:-"pack"} +echo $param1 + cd `dirname $0`/.. cur_dir=$(pwd) @@ -19,7 +21,7 @@ dist_wechat_dir="wechat-dev-tools-xsp" dist_wechat_package="wechat-v${wechat_v}-nwjs-v${nwjs_v}.tar.gz" if [ $param1 = "install" ]; then - echo "asd" + echo "install" # rm -rf $tmp_dir fi @@ -49,9 +51,17 @@ if [ $param1 = "install" ]; then cd "$cur_dir/dist" ln -s "$cur_dir/package.nw" sh scripts/install.sh - # rm -rf $tmp_dir -else +elif [ $param1 = "build" ]; then + cp -r "$nwjs_dir"/* "$cur_dir/scripts" "$cur_dir/dist" + cd "$cur_dir/dist" + ln -s "$cur_dir/package.nw" +elif [ $param1 = "pack" ]; then cp -r "$nwjs_dir"/* "$cur_dir/package.nw" "$cur_dir/scripts" "$cur_dir/dist" mkdir -p $tmp_dir/build tar -zcvf "$tmp_dir/build/$dist_wechat_package" -C "$cur_dir" dist +else + echo "不支持$param1操作" + exit 127 fi +echo "$param1 success" + diff --git a/readme.md b/readme.md index d47b67063..25ae9a454 100644 --- a/readme.md +++ b/readme.md @@ -18,7 +18,8 @@ linux下使用微信web开发者工具. ### 如果不需要小程序开发 ```console git clone git@github.com:cytle/wechat_web_devtools.git -cd wechat_web_devtools/dist && ./nw +cd wechat_web_devtools && sh ./bin/pack.sh build +cd dist && ./nw ``` ### 需要小程序开发 diff --git a/scripts/install.sh b/scripts/install.sh index f27947087..82cb7b2fe 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -7,7 +7,6 @@ dev_tools_config_dir="$HOME/.config/微信web开发者工具" rm -rf $dev_tools_config_dir -# TODO close nw ./nw & nw_pid=$!