diff options
author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2019-12-02 14:16:26 +0100 |
---|---|---|
committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-05-13 11:03:51 +0200 |
commit | b9111ae802b871d2addde1520f1acc7a04733038 (patch) | |
tree | 7eda060a9668754a5aa2ae5474053460047d656f | |
parent | 533f812ca7c7840a1be48839f82c5bea8a0ea3a5 (diff) | |
download | rabbitmq-server-git-b9111ae802b871d2addde1520f1acc7a04733038.tar.gz |
scripts/rabbitmq-env.bat: Replace `where.exe` by a PowerShell command
On Amazon AWS EC2 Windows Server 2019 image, `where.exe` is unavailable.
Fortunately, we can achieve the same thing with a plain PowerShell
oneliner which should work everywhere.
PowerShell is provided with Windows since Windows 7 (2009) according to
Wikipedia.
(cherry picked from commit cc98cb3c79748cb623310f1500285d2a3d6a81d9)
-rw-r--r-- | scripts/rabbitmq-env.bat | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/rabbitmq-env.bat b/scripts/rabbitmq-env.bat index bdfb1a97e7..92853a2362 100644 --- a/scripts/rabbitmq-env.bat +++ b/scripts/rabbitmq-env.bat @@ -23,7 +23,7 @@ if defined ERL_LIBS ( REM If ERLANG_HOME is not defined, check if "erl.exe" is available in
REM the path and use that.
if not defined ERLANG_HOME (
- for /f "delims=" %%F in ('where.exe erl.exe') do @set ERL_PATH=%%F
+ for /f "delims=" %%F in ('PowerShell.exe -Command "(Get-Command erl.exe).Definition"') do @set ERL_PATH=%%F
if exist "!ERL_PATH!" (
for /f "delims=" %%F in ("!ERL_PATH!") do set ERL_DIRNAME=%%~dpF
for /f "delims=" %%F in ("!ERL_DIRNAME!\..") do @set ERLANG_HOME=%%~dpF%%~nF%%~xF
|