From 7629549db84dc57a7c5e71b93ec9baf628be5e7e Mon Sep 17 00:00:00 2001 From: Saikari Date: Mon, 2 Feb 2026 04:25:09 +0300 Subject: refactor: improve ape programfile detection for Linux and enhance MacOS stdin command handling --- tests/modules/stdin/test.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/modules/stdin/test.lua') diff --git a/tests/modules/stdin/test.lua b/tests/modules/stdin/test.lua index 3f3539c61..9911048d5 100644 --- a/tests/modules/stdin/test.lua +++ b/tests/modules/stdin/test.lua @@ -6,7 +6,7 @@ function main(t) -- Fix /usr/bin/ape loader mode on Linux local function fix_ape_programfile(xmake) - if os.host() == "linux" and path.filename(xmake) == "ape" and os.isfile("/proc/self/cmdline") then + if os.host() == "linux" and path.filename(xmake):find("ape", 1, true) and os.isfile("/proc/self/cmdline") then local file = io.open("/proc/self/cmdline", "rb") if file then local content = file:read("*a") @@ -36,7 +36,7 @@ function main(t) local run_stdin = string.format('env "%s" l --stdin', xmake) -- Fix pwsh and cosmocc "exec format error" for MacOS - if is_ape and os.host() == "macosx" then + if is_ape and os.host() ~= "windows" then run_stdin = string.format("sh -c ' \\\"%s\\\" l --stdin '", xmake) end -- cgit v1.3.1