diff --git a/bin/wechat-devtools b/bin/wechat-devtools index 068c93b..9acb6d6 100755 --- a/bin/wechat-devtools +++ b/bin/wechat-devtools @@ -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 "$@" diff --git a/bin/wechat-devtools-cli b/bin/wechat-devtools-cli index f3e1082..fa5ebe3 100755 --- a/bin/wechat-devtools-cli +++ b/bin/wechat-devtools-cli @@ -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 "$@" diff --git a/readme.md b/readme.md index 1044d61..a23c89a 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ # 进度 -当前工具可以在Linux上构筑最新版1.02.2004020(截止时间2020年4月2日),但目前暂不支持CLI模式。 +当前工具可以在Linux上构筑最新版1.02.2004020(截止时间2020年4月2日),支持CLI模式。 # 使用方法 diff --git a/tools/update-wechat-devtools b/tools/update-wechat-devtools index 0894279..928c92e 100755 --- a/tools/update-wechat-devtools +++ b/tools/update-wechat-devtools @@ -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) { diff --git a/wine/wcc b/wine/wcc new file mode 100755 index 0000000..6f916dd --- /dev/null +++ b/wine/wcc @@ -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" "$@" diff --git a/wine/wcsc b/wine/wcsc new file mode 100755 index 0000000..df8ba01 --- /dev/null +++ b/wine/wcsc @@ -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" "$@"