add direct command supports to avoid wine-binfmt

This commit is contained in:
Minun 2020-04-10 19:17:58 +08:00
parent ff3093a616
commit f031ab7350
6 changed files with 36 additions and 5 deletions

View File

@ -8,10 +8,10 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
cd $APPDATA/..
cd $DIR/..
export WECHAT_DEVTOOLS_DIR="$DIR/../nwjs"
export APPDATA="$DIR/../nwjs"
export PATH="$DIR/../node/bin:$DIR/../nwjs:$PATH"
export PATH="$DIR/../wine:$DIR/../node/bin:$DIR/../nwjs:$PATH"
LANG=zh_CN.UTF-8 exec "$DIR"/../nwjs/nw --load-extension="$DIR"/../nwjs/package.nw/js/ideplugin "$@"

View File

@ -8,10 +8,10 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
cd $APPDATA/..
cd $DIR/..
export WECHAT_DEVTOOLS_DIR="$DIR/../nwjs"
export APPDATA="$DIR/../nwjs"
export PATH="$DIR/../node/bin:$DIR/../nwjs:$PATH"
export PATH="$DIR/../wine:$DIR/../node/bin:$DIR/../nwjs:$PATH"
$DIR/../tools/wechat-devtools-cli "$@"

View File

@ -9,7 +9,7 @@
# 进度
当前工具可以在Linux上构筑最新版1.02.2004020截止时间2020年4月2日但目前暂不支持CLI模式。
当前工具可以在Linux上构筑最新版1.02.2004020截止时间2020年4月2日支持CLI模式。
# 使用方法

View File

@ -137,6 +137,15 @@ const packageDir = "$APPDATA/Tencent/微信开发者工具/package.nw";
@.task.execute(@path(__dirname, "patch-wechat-devtools"), [], false, this.test);
}).then(function () {
@info("Patching wcc and wcsc");
@.fs.copyFile.sync(@path(__dirname, "../wine/wcc"), @path(__dirname, "package.nw/js/vendor/wcc"));
@.fs.copyFile.sync(@path(__dirname, "../wine/wcsc"), @path(__dirname, "package.nw/js/vendor/wcsc"));
this.next();
}).finished((error) => {
if (error) {

11
wine/wcc Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
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
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
wine "$DIR/wcc.exe" "$@"

11
wine/wcsc Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
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
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
wine "$DIR/wcsc.exe" "$@"