UNPKG

wangyj

Version:

wangyj 个人常用命令库

21 lines (20 loc) 917 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.inject = void 0; const node_console_1 = require("node:console"); const node_fs_1 = require("node:fs"); const getTargetPath_1 = require("./getTargetPath"); const hasTargetRule_1 = require("./hasTargetRule"); const formatOutput_1 = require("../../../utils/formatOutput"); // 读取文件路径 const css_path = (0, getTargetPath_1.getTargetPath)(); // 注入的内容 const inject_content = `.monaco-workbench.windows:lang(zh-Hans){font-family:Maple Mono Normal NF CN !important;}`; const inject = () => { if (!(0, hasTargetRule_1.hasTargetRule)((0, node_fs_1.readFileSync)(css_path, "utf-8"))) { (0, node_console_1.log)("injecting..."); (0, node_fs_1.appendFileSync)(css_path, inject_content); } (0, formatOutput_1.formatOutput)("注入结束", "already injected", "success"); }; exports.inject = inject;