mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
Okay lets try poweshell again
This commit is contained in:
parent
7cbeafc5b3
commit
c13728fce4
1 changed files with 4 additions and 1 deletions
|
@ -5,7 +5,10 @@ local expected = "Hello from child process!"
|
||||||
-- NOTE: This requires "bash" to be installed even for Windows
|
-- NOTE: This requires "bash" to be installed even for Windows
|
||||||
-- users, testing a simple cat from stdin to stdout using pwsh
|
-- users, testing a simple cat from stdin to stdout using pwsh
|
||||||
-- has unfortunately proved to be a significant challenge...
|
-- has unfortunately proved to be a significant challenge...
|
||||||
local result = process.exec("bash", { "-c", "cat" }, { stdio = { stdin = expected } })
|
local options = { stdio = { stdin = expected } }
|
||||||
|
local result = if process.os == "windows"
|
||||||
|
then process.exec("powershell", { "-Command", "{ & bash -c cat }" }, options)
|
||||||
|
else process.exec("bash", { "-c", "cat" }, options)
|
||||||
|
|
||||||
local resultStdout = result.stdout
|
local resultStdout = result.stdout
|
||||||
resultStdout = string.gsub(resultStdout, "^%s+", "") -- Trim leading whitespace
|
resultStdout = string.gsub(resultStdout, "^%s+", "") -- Trim leading whitespace
|
||||||
|
|
Loading…
Add table
Reference in a new issue