wechat-web-devtools-linux/bin/wechat-devtools-cli
2024-01-02 10:45:32 +08:00

21 lines
794 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
root_dir="$( cd -P "$( dirname "$SOURCE" )"/.. >/dev/null 2>&1 && pwd )"
cd $root_dir
export WECHAT_DEVTOOLS_DIR="$root_dir/nwjs"
export APPDATA="$root_dir/nwjs"
export PATH="$root_dir/node/bin:$root_dir/nwjs:$PATH"
node $root_dir/package.nw/js/common/cli/index.js "$@"
if [ ! -z "$APPIMAGE" ];then
# AppImage在程序退出后会删除相关程序文件导致无法启动
tail -f /etc/issue
fi