From a37cb16a4143043d2ea06996fa19be366ff495d9 Mon Sep 17 00:00:00 2001 From: msojocs Date: Tue, 10 May 2022 18:30:22 +0800 Subject: [PATCH] fix: vscode-ripgrep #51 --- test/test-bash | 30 ------------------------------ test/test.sh | 8 ++++++++ tools/fix-other.sh | 1 + tools/rebuild-node-modules.sh | 16 +++++++--------- 4 files changed, 16 insertions(+), 39 deletions(-) delete mode 100644 test/test-bash create mode 100644 test/test.sh diff --git a/test/test-bash b/test/test-bash deleted file mode 100644 index 4cf188b..0000000 --- a/test/test-bash +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -BUILD_VERSION='v1' -if [[ ! $BUILD_VERSION -eq 'continuous' ]];then - BUILD_VERSION=v0 -fi -echo $BUILD_VERSION -sed -i "s/BUILD_VERSION/${BUILD_VERSION//v/}/" "/mnt/disk2/wechat-web-devtools-linux/tmp/deb/DEBIAN/control" - -exit - -if [[ $NO_WINE == 'true' ]];then - echo "not wine" -fi - -if [[ $@ =~ -ll ]];then - echo "include" -fi -exit - -echo "$@ $0 $1 $2" - -root_dir=$(cd `dirname $0`/.. && pwd -P) -cd $root_dir/tmp -export HTTPS_PROXY="http://127.0.0.1:7890" -# npm uninstall vscode-ripgrep -# npm install vscode-ripgrep -cd $root_dir/tmp/node_modules/vscode-ripgrep -rm -rf bin /tmp/vscode-ripgrep-cache-1.13.2/ripgrep-v13.0.0-4-x86_64-unknown-linux-musl.tar.gz -npm run postinstall diff --git a/test/test.sh b/test/test.sh new file mode 100644 index 0000000..95d2054 --- /dev/null +++ b/test/test.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +root_dir=$(cd `dirname $0`/.. && pwd -P) +# https://mirror.ghproxy.com/https://github.com/microsoft/ripgrep-prebuilt/releases/download/v12.1.1-1/ripgrep-v12.1.1-1-x86_64-unknown-linux-musl.tar.gz +cd $root_dir/tmp &&\ +mkdir -p vscode-ripgrep/bin && cd vscode-ripgrep && \ +wget https://gh2.yanqishui.work/https://github.com/microsoft/ripgrep-prebuilt/releases/download/v12.1.1-1/ripgrep-v12.1.1-1-x86_64-unknown-linux-musl.tar.gz -O ripgrep-v12.1.1-1-x86_64-unknown-linux-musl.tar.gz && \ +tar xvf ripgrep-v12.1.1-1-x86_64-unknown-linux-musl.tar.gz -C ./bin \ No newline at end of file diff --git a/tools/fix-other.sh b/tools/fix-other.sh index c708180..5629465 100755 --- a/tools/fix-other.sh +++ b/tools/fix-other.sh @@ -15,6 +15,7 @@ sed -i 's#module.exports = createWebviewManager;#module.exports = createWebviewM # 修复:可视化用的wcc,wcsc echo "fix: wcc,wcsc" # wcc wcsc +ls -l "${srcdir}/compiler" # 可视化编译 (cd "${package_dir}/node_modules/" \ && rm -rf wcc \ diff --git a/tools/rebuild-node-modules.sh b/tools/rebuild-node-modules.sh index f6253b0..f0d93ce 100755 --- a/tools/rebuild-node-modules.sh +++ b/tools/rebuild-node-modules.sh @@ -80,7 +80,6 @@ export JOBS=$max_thread spdlog@0.11.1 \ trash \ vscode-oniguruma \ - @vscode/ripgrep \ nodegit \ --registry=https://registry.npmmirror.com \ --nodegit_binary_host_mirror=https://npmmirror.com/mirrors/nodegit/v0.27.0/ ) # reinstall modules @@ -105,14 +104,13 @@ cd "$package_dir/node_modules_tmp/node_modules/spdlog" && nw-gyp rebuild --arch= (cd "${package_dir}/node_modules_tmp/node_modules" && find -name ".deps" | xargs -I{} rm -rf {} && find -name "obj.target" | xargs -I{} rm -rf {} && find -name "*.a" -delete && find -name "*.lib" -delete && find -name "*.mk" -delete) (cd "${package_dir}/node_modules_tmp/node_modules" && find -name "*.node" | xargs -I{} \cp -rf {} ${package_dir}/node_modules/{}) -cd "${package_dir}/node_modules_tmp/node_modules/@vscode/ripgrep" && \ -sed -i 's/api.github.com/wechat-devtools.jiyecafe.workers.dev/' lib/download.js && \ -sed -i "s/ const release/ downloadOpts.headers.upstream = 'api.github.com';const release/" lib/download.js && \ -sed -i "s/ return download/ opts.headers.upstream = 'objects.githubusercontent.com';return download/" lib/download.js && \ -sed -i 's/response.headers.location,/response.headers.location.replace("objects.githubusercontent.com", "wechat-devtools.jiyecafe.workers.dev"),/' lib/download.js && \ -npm run postinstall -mkdir -p "${package_dir}/node_modules/vscode-ripgrep/bin" -\cp -fr "${package_dir}/node_modules_tmp/node_modules/@vscode/ripgrep/bin/rg" "${package_dir}/node_modules/vscode-ripgrep/bin/rg" +# https://github.com/microsoft/ripgrep-prebuilt +cd "${package_dir}/node_modules_tmp/node_modules" && \ +mkdir -p vscode-ripgrep/bin && cd vscode-ripgrep && \ +wget https://gh2.yanqishui.work/https://github.com/microsoft/ripgrep-prebuilt/releases/download/v12.1.1-1/ripgrep-v12.1.1-1-x86_64-unknown-linux-musl.tar.gz -O ripgrep-v12.1.1-1-x86_64-unknown-linux-musl.tar.gz && \ +tar xvf ripgrep-v12.1.1-1-x86_64-unknown-linux-musl.tar.gz -C ./bin +mkdir -p ${package_dir}/node_modules/vscode-ripgrep/bin &&\ +\cp -fr "${package_dir}/node_modules_tmp/node_modules/vscode-ripgrep/bin/rg" "${package_dir}/node_modules/vscode-ripgrep/bin/rg" (cd "${package_dir}/node_modules" && find -name ".deps" | xargs -I{} rm -rf {} && find -name "obj.target" | xargs -I{} rm -rf {} && find -name "*.a" -delete && find -name "*.lib" -delete && find -name "*.mk" -delete && find -name "*Makefile" -delete && find -name "*gyp*" -delete) rm -rf "${package_dir}/node_modules_tmp"