Skip to content
This repository has been archived by the owner on Apr 7, 2018. It is now read-only.

Commit

Permalink
Merge pull request #211 from surik/conform_args_to_command_line
Browse files Browse the repository at this point in the history
Add conform schema and config paths to command line
  • Loading branch information
bitwalker committed Oct 14, 2015
2 parents 27b3509 + cbbce28 commit 4b357f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions priv/rel/files/boot
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ERTS_VSN=$(cat $RELEASES_DIR/start_erl.data | cut -d' ' -f1)
REL_DIR="$RELEASES_DIR/$REL_VSN"
REL_LIB_DIR="$RELEASE_ROOT_DIR/lib"
ERL_OPTS="{{{ERL_OPTS}}}"
CONFORM_OPTS=""
PIPE_DIR="$RELEASE_ROOT_DIR/tmp/erl_pipes/{{{PROJECT_NAME}}}/"
ERTS_DIR=""
ROOTDIR=""
Expand Down Expand Up @@ -115,6 +116,7 @@ generate_config() {
if [ ! -f "$__conform" ]; then
__conform="$ROOTDIR/bin/conform"
fi
CONFORM_OPTS="-conform_schema ${__schema_file} -conform_config ${__conform_file}"
result="$("$BINDIR/escript" "$__conform" --conf "$__conform_file" --schema "$__schema_file" --config "$SYS_CONFIG" --output-dir "$GENERATED_CONFIG_DIR")"
exit_status="$?"
if [ "$exit_status" -ne 0 ]; then
Expand Down Expand Up @@ -530,6 +532,7 @@ case "$1" in
-pa "$REL_LIB_DIR/consolidated" \
-args_file "$VMARGS_PATH" \
${ERL_OPTS} \
${CONFORM_OPTS} \
-user Elixir.IEx.CLI -extra --no-halt +iex

# Dump environment info for logging purposes
Expand Down Expand Up @@ -571,6 +574,7 @@ case "$1" in
-pa "$REL_LIB_DIR/consolidated" \
-env ERL_LIBS "$REL_LIB_DIR" \
${ERL_OPTS} \
${CONFORM_OPTS} \
-args_file "$VMARGS_PATH"

# Dump environment info for logging purposes
Expand Down
4 changes: 3 additions & 1 deletion priv/rel/files/boot.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
:: Set variables that describe the release
@set rel_name={{{PROJECT_NAME}}}
@set erl_opts={{{ERL_OPTS}}}
@set conform_opts=""

:: Discover the release root directory from the directory of this script
@set script_dir=%~dp0
Expand Down Expand Up @@ -136,6 +137,7 @@
)
@if exist "%conform_schema%" (
if exist "%conform_conf%" (
set conform_opts="-conform_schema %conform_schema% -conform_config %conform_conf%"
"%escript%" "%conform%" --conf "%conform_conf%" --schema "%conform_schema%" --config "%sys_config%" --output-dir "%rel_dir%"
if 1==%ERRORLEVEL% (
exit /b %ERRORLEVEL%
Expand Down Expand Up @@ -176,7 +178,7 @@
:install
@if "" == "%2" (
:: Install the service
set args=%erl_opts% -setcookie %cookie% ++ -rootdir \"%rootdir%\"
set args=%erl_opts% %conform_opts% -setcookie %cookie% ++ -rootdir \"%rootdir%\"
set start_erl=%erts_dir%\bin\start_erl.exe
set description=Erlang node %node_name% in %rootdir%
%erlsrv% add %service_name% %node_type% "%node_name%" -c "%description%" ^
Expand Down

0 comments on commit 4b357f0

Please sign in to comment.