mirror of
https://github.com/darkings/Obsidian-MonokaiSyntax.git
synced 2026-07-22 04:40:26 +00:00
为 Obsidian 社区主题提交做准备: - Vite 构建同时输出 theme.css 到根目录 - 同步脚本、审计脚本、Release CI 统一引用根目录路径 - 截图调整为 512×288(社区列表规范尺寸)
20 lines
777 B
JavaScript
20 lines
777 B
JavaScript
import { copyFileSync, mkdirSync } from "node:fs";
|
||
import { resolve } from "node:path";
|
||
|
||
const rootDir = resolve(import.meta.dirname, "..");
|
||
const vaultRoot = process.argv[2] ?? process.env.OBSIDIAN_VAULT;
|
||
|
||
if (!vaultRoot) {
|
||
console.error("请设置 OBSIDIAN_VAULT 环境变量或通过命令行参数指定 Vault 路径");
|
||
console.error("示例:npm run sync:vault -- D:/你的/Obsidian/Vault");
|
||
process.exit(1);
|
||
}
|
||
|
||
const vaultThemeDir = resolve(vaultRoot, ".obsidian/themes/Monokai Syntax");
|
||
|
||
mkdirSync(vaultThemeDir, { recursive: true });
|
||
|
||
copyFileSync(resolve(rootDir, "theme.css"), resolve(vaultThemeDir, "theme.css"));
|
||
copyFileSync(resolve(rootDir, "manifest.json"), resolve(vaultThemeDir, "manifest.json"));
|
||
|
||
console.log(`已同步主题到:${vaultThemeDir}`);
|