Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 2.01.2510290-2 / 2026-04-
- fix: cli端口启动失败
- fix: 直接使用cli进行初次启动会报错

# 2.01.2510290-1 / 2026-03-28
- update: devtools to v2.01.2510290
Expand Down
18 changes: 16 additions & 2 deletions bin/wechat-devtools-cli
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,26 @@ root_dir="$( cd -P "$( dirname "$SOURCE" )"/.. >/dev/null 2>&1 && pwd )"

cd $root_dir/bin

# 数据目录处理
if [ -z "$XDG_CONFIG_HOME" ];then
DATA_DIR=$HOME/.config
else
DATA_DIR=$XDG_CONFIG_HOME
fi

# 获取App名称
APP_NAME=$( cat "$root_dir/package.nw/package.json" | grep -Eo 'name":".*","main' )
APP_NAME=${APP_NAME//name\":\"/}
APP_NAME=${APP_NAME//\",\"main/}

export WECHAT_DEVTOOLS_DIR="$root_dir/nwjs"
export APPDATA="$root_dir/nwjs"
export APPDATA="$DATA_DIR/$APP_NAME"
export USERPROFILE="$APPDATA"
export PATH="$root_dir/node/bin:$root_dir/nwjs:$PATH"
mkdir -p "$APPDATA/Default"

node $root_dir/package.nw/js/common/cli/index.js "$@"
if [ ! -z "$APPIMAGE" ];then
# AppImage在程序退出后会删除相关程序文件,导致无法启动
tail -f /etc/issue
fi
fi