summarylogtreecommitdiffstats
path: root/wechat-devtools-cli
diff options
context:
space:
mode:
authormsojocs2022-04-12 23:06:57 +0800
committermsojocs2022-04-12 23:06:57 +0800
commit6415cbfe1239f0d4e842cdca5a464dfb68cdb630 (patch)
treecf4018b0534d9e066d943890fe395c3df23950c2 /wechat-devtools-cli
parent8de184d8992f392fb52a403f0b0c52bafe8e92f8 (diff)
downloadaur-6415cbfe1239f0d4e842cdca5a464dfb68cdb630.tar.gz
fix: 命令行启动 & cli
Diffstat (limited to 'wechat-devtools-cli')
-rw-r--r--wechat-devtools-cli17
1 files changed, 17 insertions, 0 deletions
diff --git a/wechat-devtools-cli b/wechat-devtools-cli
new file mode 100644
index 000000000000..358007822327
--- /dev/null
+++ b/wechat-devtools-cli
@@ -0,0 +1,17 @@
+#!/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/wine:$root_dir/node/bin:$root_dir/nwjs:$PATH"
+
+node $root_dir/package.nw/js/common/cli/index.js "$@" \ No newline at end of file