feat:检测是否安装Java fix:修复彩色字体无法显示

This commit is contained in:
Tianpao
2025-07-24 11:22:01 +08:00
parent 777d8e43aa
commit 9f9cfc3e17
5 changed files with 29 additions and 25 deletions

View File

@@ -8,6 +8,7 @@ import env from "dotenv";
import { MultiBar } from "cli-progress";
import { URL, fileURLToPath } from "node:url";
import { LOGGER } from "./logger.js";
import { exec } from "node:child_process";
export async function readzipentry(
zipfile: yauzl.ZipFile,
@@ -179,3 +180,15 @@ export const isDevelopment = (() => {
env.config();
return process.env.DEVELOPMENT;
})();
export const isInstallJava:Promise<boolean> = (() => {
return new Promise((resolve) => {
exec("java -version", (err) => {
if (err) {
resolve(false);
} else {
resolve(true);
}
});
});
})();