Thanks @ymat19. Co-authored-by: ymat19 <45934497+ymat19@users.noreply.github.com>
The previous check used includes("win") which incorrectly matched "darwin" (macOS) because it contains "win". This caused cmd.exe to be used on macOS instead of /bin/sh.