@@ -136,7 +136,7 @@ defmodule Mix.Tasks.Release.Init do
136
136
;;
137
137
138
138
*)
139
- echo "ERROR: Expected sname, name, or none in RELEASE_DISTRIBUTION , got: $RELEASE_DISTRIBUTION" >&2
139
+ echo "ERROR: Expected RELEASE_DISTRIBUTION to be sname, name, or none, got: $RELEASE_DISTRIBUTION" >&2
140
140
exit 1
141
141
;;
142
142
esac
@@ -280,7 +280,7 @@ defmodule Mix.Tasks.Release.Init do
280
280
rem set RELEASE_MODE=interactive
281
281
282
282
rem Set the release to work across nodes.
283
- rem RELEASE_DISTRIBUTION must be " sname" (local), " name" (distributed) or " none" .
283
+ rem RELEASE_DISTRIBUTION must be sname (local), name (distributed) or none.
284
284
rem set RELEASE_DISTRIBUTION=name
285
285
rem set RELEASE_NODE=<%= @release.name %>
286
286
"""
@@ -314,13 +314,33 @@ defmodule Mix.Tasks.Release.Init do
314
314
if not defined RELEASE_BOOT_SCRIPT_CLEAN (set RELEASE_BOOT_SCRIPT_CLEAN=start_clean)
315
315
if not defined RELEASE_SYS_CONFIG (set RELEASE_SYS_CONFIG=!REL_VSN_DIR!\sys)
316
316
317
+ if "!RELEASE_DISTRIBUTION!" == "none" (
318
+ rem
319
+ ) else if "!RELEASE_DISTRIBUTION!" == "name" (
320
+ rem
321
+ ) else if "!RELEASE_DISTRIBUTION!" == "sname" (
322
+ rem
323
+ ) else (
324
+ echo ERROR: Expected RELEASE_DISTRIBUTION to be sname, name, or none, got: !RELEASE_DISTRIBUTION!
325
+ exit /B 1
326
+ )
327
+
328
+ if "!RELEASE_MODE!" == "embedded" (
329
+ rem
330
+ ) else if "!RELEASE_MODE!" == "interactive" (
331
+ rem
332
+ ) else (
333
+ echo ERROR: Expected RELEASE_MODE to be embedded or interactive, got: !RELEASE_MODE!
334
+ exit /B 1
335
+ )
336
+
317
337
if "%~1" == "start" (set "REL_EXEC=elixir" && set "REL_EXTRA=--no-halt" && set "REL_GOTO=start")
318
338
if "%~1" == "start_iex" (set "REL_EXEC=iex" && set "REL_EXTRA=--werl" && set "REL_GOTO=start")
319
339
if "%~1" == "install" (set "REL_GOTO=install")
320
340
if "%~1" == "eval" (
321
341
if "%~2" == "" (
322
342
echo ERROR: EVAL expects an expression as argument
323
- goto end
343
+ exit /B 1
324
344
)
325
345
set "REL_GOTO=eval"
326
346
)
@@ -348,7 +368,7 @@ defmodule Mix.Tasks.Release.Init do
348
368
if "%~1" == "rpc" (
349
369
if "%~2" == "" (
350
370
echo ERROR: RPC expects an expression as argument
351
- goto end
371
+ exit /B 1
352
372
)
353
373
set "REL_RPC=%~2"
354
374
goto rpc
@@ -369,7 +389,10 @@ defmodule Mix.Tasks.Release.Init do
369
389
echo pid Prints the operating system PID of the running system via a remote command
370
390
echo version Prints the release name and version to be booted
371
391
echo.
372
- if not "%~1" == "" (echo ERROR: Unknown command %~1)
392
+ if not "%~1" == "" (
393
+ echo ERROR: Unknown command %~1
394
+ exit /B 1
395
+ )
373
396
goto end
374
397
375
398
:start
@@ -427,7 +450,7 @@ defmodule Mix.Tasks.Release.Init do
427
450
if "!RELEASE_DISTRIBUTION!" == "none" (
428
451
set RELEASE_DISTRIBUTION_FLAG=
429
452
) else (
430
- set RELEASE_DISTRIBUTION_FLAG=--!RELEASE_DISTRIBUTION! "rem -!RANDOM!-!RELEASE_NODE!"
453
+ set RELEASE_DISTRIBUTION_FLAG=--!RELEASE_DISTRIBUTION! "rpc -!RANDOM!-!RELEASE_NODE!"
431
454
)
432
455
433
456
"!REL_VSN_DIR!\elixir.bat" ^
@@ -452,7 +475,7 @@ defmodule Mix.Tasks.Release.Init do
452
475
453
476
if "!RELEASE_DISTRIBUTION!" == "none" (
454
477
echo ERROR: RELEASE_DISTRIBUTION is required in install command
455
- goto end
478
+ exit /B 1
456
479
)
457
480
458
481
"!ERLSRV!" add "!RELEASE_NAME!_!RELEASE_NAME!" ^
0 commit comments