1 Star 0 Fork 41

风之影sky/eSearch

forked from xsf-root/eSearch 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
before_pack.js 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
xsf-root 提交于 2022-10-29 22:46 +08:00 . 主要 win安装vc依赖
const fs = require("fs");
const path = require("path");
const download = require("download");
exports.default = async function () {
// 重写存储器
const storeindex = path.join(__dirname, "/node_modules/electron-store/index.js");
fs.writeFileSync(
storeindex,
fs
.readFileSync(storeindex)
.toString()
.replace(/ipcMain\.on\(.*\n.*\n.*?;/, "")
);
if (!fs.existsSync("./ocr/ppocr/默认")) {
fs.mkdirSync("./ocr/ppocr/默认", { recursive: true });
fs.writeFileSync(
"./ocr/ppocr/默认/ppocr_det.onnx",
await download(
"https://github.com/xushengfeng/eSearch-OCR/releases/download/3.0.0/ch_PP-OCRv3_det_infer.onnx",
{ rejectUnauthorized: false }
)
);
fs.writeFileSync(
"./ocr/ppocr/默认/ppocr_rec.onnx",
await download(
"https://github.com/xushengfeng/eSearch-OCR/releases/download/3.0.0/ch_PP-OCRv3_rec_infer.onnx",
{ rejectUnauthorized: false }
)
);
fs.writeFileSync(
"./ocr/ppocr/默认/ppocr_keys_v1.txt",
await download("https://github.com/xushengfeng/eSearch-OCR/releases/download/3.0.0/ppocr_keys_v1.txt", {
rejectUnauthorized: false,
})
);
}
if (process.platform == "win32" && !fs.existsSync("./build/vc_redist.x64.exe")) {
fs.writeFileSync(
"./build/vc_redist.x64.exe",
await download("https://aka.ms/vs/17/release/vc_redist.x64.exe", {
rejectUnauthorized: false,
})
);
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/sky8652/eSearch.git
git@gitee.com:sky8652/eSearch.git
sky8652
eSearch
eSearch
master

搜索帮助