Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit c04ad50

Browse files
committed
Fix: 非Linux检查输出问题
1 parent 06cbf6a commit c04ad50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/service/install.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ const PTY_DIR_PATH = path.join(process.cwd(), "lib");
2929

3030
function installPtyForLinux(url: string) {
3131
return new Promise<number>((resolve, reject) => {
32-
if (os.platform() !== "linux" || os.arch() !== "x64") {
32+
if (os.arch() !== "x64") {
3333
if (!fs.existsSync(PTY_PATH)) logger.info("仿真终端只能支持 Windows/Linux x86_64 架构,已自动降级为普通终端");
3434
resolve(-1);
3535
}
36-
3736
if (!fs.existsSync(PTY_DIR_PATH)) fs.mkdirsSync(PTY_DIR_PATH);
3837
if (fs.existsSync(PTY_PATH) && fs.statSync(PTY_PATH)?.size > 1024) {
3938
logger.info("识别到可选依赖库安装,仿真终端功能已可用");
@@ -65,6 +64,7 @@ function installPtyForLinux(url: string) {
6564
// 仿真终端依赖程序,基于 Go/C++ 实现的 PTY 程序
6665
// 参考:https://github.com/MCSManager/pty
6766
export function initDependent() {
67+
if (os.platform() !== "linux") return logger.info("检测到系统不是 Linux 系统,自动跳过依赖库安装");
6868
const ptyUrls = ["https://mcsmanager.com/download/pty_linux", "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/pty_linux"];
6969
function setup(index = 0) {
7070
installPtyForLinux(ptyUrls[index])

0 commit comments

Comments
 (0)