feat:检测是否安装Java fix:修复彩色字体无法显示
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user