From 8e865ebc77344afb17533476f8f5cdd64d5e085a Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Sat, 23 Aug 2025 11:05:22 +0200 Subject: [PATCH] Fix tool detection on Windows OS `command` is a unix shell builtin command which is not available on Windows, even in a MSYS2 enabled environment. This is because ruby runs the string passed to `Kernel.system` in a `cmd` shell, which doesn't know this command. But `where` is a proper replacement on Windows. --- lib/tasks/cssbundling/build.rake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tasks/cssbundling/build.rake b/lib/tasks/cssbundling/build.rake index a8cefde..a76a4ef 100644 --- a/lib/tasks/cssbundling/build.rake +++ b/lib/tasks/cssbundling/build.rake @@ -51,7 +51,11 @@ module Cssbundling private def tool_exists?(tool) - system "command -v #{tool} > /dev/null" + if RUBY_PLATFORM =~ /mingw|mswin/ + system "where #{tool} > NUL 2> NUL" + else + system "command -v #{tool} > /dev/null" + end end def using_tool?(tool)