From b6e452ccac0cbf150c8ffc4a9738e7e9202fc07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 19 Feb 2024 17:18:37 +0800 Subject: =?UTF-8?q?=E6=8C=AA=E5=88=B0=20bee.windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/proto/proto.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'script/proto') diff --git a/script/proto/proto.lua b/script/proto/proto.lua index d01c8f36..2460b4ec 100644 --- a/script/proto/proto.lua +++ b/script/proto/proto.lua @@ -1,5 +1,3 @@ -local subprocess = require 'bee.subprocess' -local socket = require 'bee.socket' local util = require 'utility' local await = require 'await' local pub = require 'pub' @@ -7,7 +5,7 @@ local jsonrpc = require 'jsonrpc' local define = require 'proto.define' local json = require 'json' local inspect = require 'inspect' -local thread = require 'bee.thread' +local platform = require 'bee.platform' local fs = require 'bee.filesystem' local net = require 'service.net' local timer = require 'timer' @@ -234,8 +232,11 @@ end function m.listen(mode, socketPort) m.mode = mode if mode == 'stdio' then - subprocess.filemode(io.stdin, 'b') - subprocess.filemode(io.stdout, 'b') + if platform.OS == 'Windows' then + local windows = require 'bee.windows' + windows.filemode(io.stdin, 'b') + windows.filemode(io.stdout, 'b') + end io.stdin:setvbuf 'no' io.stdout:setvbuf 'no' pub.task('loadProtoByStdio') -- cgit v1.2.3