This repository was archived by the owner on Nov 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,10 @@ const PTY_DIR_PATH = path.join(process.cwd(), "lib");
2929
3030function 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
6766export 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 ] )
You can’t perform that action at this time.
0 commit comments