wechat-web-devtools-linux/bin/wechat-devtools
msojocs 3b14d60568 Squashed commit of the following:
commit 500396a38e3b4c46ef23eae3b9daa41845a87598
Author: msojocs <jiyecafe@gmail.com>
Date:   Sat Mar 5 15:28:38 2022 +0800

    update: no wine

commit f5396dcaa5d56fcf6f7cb9ca1e8e14fa06b6b48d
Author: msojocs <jiyecafe@gmail.com>
Date:   Sat Mar 5 15:11:21 2022 +0800

    fix: permission

commit 421bcddd4b9eb41e48a41c6dc9c63870c23e9cee
Author: msojocs <jiyecafe@gmail.com>
Date:   Sat Mar 5 14:56:05 2022 +0800

    deepin
2022-03-05 15:29:56 +08:00

43 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
root_dir=$(cd `dirname $0`/.. && pwd -P)
# 数据目录处理
if [ -z $XDG_CONFIG_HOME ];then
DATA_DIR=$HOME
else
DATA_DIR=$XDG_CONFIG_HOME
fi
export WECHAT_DEVTOOLS_DIR="$root_dir/nwjs"
export APPDATA="$DATA_DIR/.config/wechat_devtools"
export PATH="$root_dir/wine:$root_dir/node/bin:$root_dir/nwjs:$PATH"
export USERPROFILE=$DATA_DIR
clean_cache() {
echo "清理缓存";
rm -rf "$APPDATA/WeappCache";
rm -rf "$APPDATA/WeappVendor";
}
# 检测是否有清除缓存的必要
if [[ -f "$APPDATA/.build_time" ]];then
diff "$APPDATA/.build_time" "$root_dir/package.nw/.build_time" >/dev/null;
if [ ! "$?" == "0" ];then
\cp -f "$root_dir/package.nw/.build_time" "$APPDATA/.build_time";
clean_cache;
fi;
else
\cp -f "$root_dir/package.nw/.build_time" "$APPDATA/.build_time";
clean_cache;
fi;
EXTENSION1="--load-extension=$root_dir/nwjs/package.nw/js/ideplugin"
EXTENSION2=--load-extension=$APPDATA/WeappPlugin
INSPECTOR1="--custom-devtools-frontend=file://$root_dir/package.nw/js/ideplugin/inspector" # 要加file://指明为本地文件路径
INSPECTOR2="--custom-devtools-frontend=file://$APPDATA/WeappPlugin/inspector/"
USERDATADIR="$APPDATA"
# "$@"参数
LANG=zh_CN.UTF-8
exec "$root_dir/nwjs/nw" $root_dir/package.nw $EXTENSION2 $INSPECTOR1 "$@"