ruby/win32/install-msys-packages.cmd
Nobuyoshi Nakada b839989fd2 win32: Add CR to all batch files.
This reverts commit 23f9a0d655c4d405bb2397a147a1523436205486, "win32:
Strip CR from batch files", and add CR to the other batch files too.

`cmd.exe` seems to work well with LF at a glance, but sometimes `goto`
jumps to an unexpected line.  This is probably because it is looking
for the beginning of a line, assuming that all lines end with CRLF,
and as a result mistaking the `goto` operand for a label.
2026-01-26 18:17:45 +09:00

30 lines
957 B
Batchfile
Executable File

::- Install msys packages for rubygems
::- The dependencies are taken from vcpkg.json to share the common info.
@setlocal EnableExtensions DisableDelayedExpansion || exit /b - 1
@set PROMPT=$h$e[96m$g$e[39m$s
@set script=%0
@call set "srcdir=%%script:\win32\%~nx0=%%"
@if not defined MINGW_PACKAGE_PREFIX (
::- Enable msys environment by ridk (from RubyInstaller-DevKit)
where ridk >nul 2>&1 || (
(echo MINGW_PACKAGE_PREFIX is not set, you have to enable development environment.) 1>&2
exit /b 1
)
call ridk enable %*
echo:
) else if not "%1" == "" (
::- Switch msys environment by ridk (from RubyInstaller-DevKit)
call ridk enable %*
echo:
)
@set pkgs=
@(
for /f %%I in ('powershell -c "(ConvertFrom-Json $input).dependencies"') do @(
call set "pkgs=%%pkgs%% %%MINGW_PACKAGE_PREFIX%%-%%%%I"
)
) < "%srcdir%\vcpkg.json"
pacman -S --needed --noconfirm %pkgs:~1%