summaryrefslogtreecommitdiff
path: root/tests/modules/stdin/test.lua
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-02-02 04:25:09 +0300
committerSaikari <[email protected]>2026-02-02 04:25:09 +0300
commit7629549db84dc57a7c5e71b93ec9baf628be5e7e (patch)
tree6b7b715144cf2a6fffbbba7447ecf4ff1be25435 /tests/modules/stdin/test.lua
parent39797ac3c7cce56399185ab71b37ee92cafc67d3 (diff)
refactor: improve ape programfile detection for Linux and enhance MacOS stdin command handling
Diffstat (limited to 'tests/modules/stdin/test.lua')
-rw-r--r--tests/modules/stdin/test.lua4
1 files changed, 2 insertions, 2 deletions
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