From d4ca3ea461a07b3cffd22d930526324b84dad310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3zsa=20Zolt=C3=A1n?= <67325669+rozsazoltan@users.noreply.github.com> Date: Sun, 19 Apr 2026 15:58:46 +0200 Subject: [PATCH] fix(windows): use NUL instead of /dev/null for quiet redirection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make QUIET redirection OS-aware so Windows commands do not write to /dev/null. The previous implementation always used Unix-style redirection: > /dev/null 2>&1 That breaks PowerShell/cmd-based install steps on Windows with: 'A rendszer nem találja a megadott elérési utat.' As a result, PIE and Composer downloads could fail even though PHP itself installed correctly. This change switches Windows to: > NUL 2>&1 while preserving: > /dev/null 2>&1 for Linux and macOS. --- lib/env.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/env.lua b/lib/env.lua index 5db54d8..b2a2cc2 100644 --- a/lib/env.lua +++ b/lib/env.lua @@ -1,3 +1,15 @@ +local function quiet_redirect() + if VERBOSE then + return "" + end + + if RUNTIME ~= nil and RUNTIME.osType == "windows" then + return " > NUL 2>&1" + end + + return " > /dev/null 2>&1" +end + local function is_enabled(env_var) local v = os.getenv(env_var) if v == nil then return false end @@ -31,7 +43,7 @@ local function parse_pie_extensions() end local VERBOSE = is_verbose() -local QUIET = VERBOSE and "" or " > /dev/null 2>&1" +local QUIET = quiet_redirect() local SKIP_DEPS = is_enabled("PHP_SKIP_DEPS") local PECL_EXTENSIONS = parse_pecl_extensions() local PIE_EXTENSIONS = parse_pie_extensions()