From 7cbeafc5b3a5f317ae2e3e7d6aa787989709de5f Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Fri, 25 Apr 2025 13:53:41 +0200 Subject: [PATCH] Enforce bash in exec stdin test instead of trying to use powershell --- tests/process/exec/stdin.luau | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/process/exec/stdin.luau b/tests/process/exec/stdin.luau index 7c8ee79..3ef8b78 100644 --- a/tests/process/exec/stdin.luau +++ b/tests/process/exec/stdin.luau @@ -2,9 +2,10 @@ local process = require("@lune/process") local expected = "Hello from child process!" -local result = if process.os == "windows" - then process.exec("powershell", { "-Command", "$input" }, { stdio = { stdin = expected } }) - else process.exec("xargs", { "echo" }, { stdio = { stdin = expected } }) +-- NOTE: This requires "bash" to be installed even for Windows +-- users, testing a simple cat from stdin to stdout using pwsh +-- has unfortunately proved to be a significant challenge... +local result = process.exec("bash", { "-c", "cat" }, { stdio = { stdin = expected } }) local resultStdout = result.stdout resultStdout = string.gsub(resultStdout, "^%s+", "") -- Trim leading whitespace