-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinit.js
28 lines (25 loc) · 885 Bytes
/
init.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
import download from "download";
if (!existsSync("./public/ocr")) {
mkdirSync("./public/ocr", { recursive: true });
await download("https://github.com/xushengfeng/eSearch-OCR/releases/download/3.0.0/ch.zip", "./public/ocr", {
rejectUnauthorized: false,
extract: true,
});
}
if (!existsSync("./lib/tikzjax.js")) {
writeFileSync(
"./lib/tikzjax.js",
await download("https://raw.githubusercontent.com/artisticat1/obsidian-tikzjax/0.5.1/tikzjax.js", {
rejectUnauthorized: false,
})
);
}
if (!existsSync("./lib/[email protected]")) {
writeFileSync(
"./lib/[email protected]",
await download("https://unpkg.com/[email protected]/es5/tex-svg-full.js", {
rejectUnauthorized: false,
})
);
}