aboutsummaryrefslogtreecommitdiffstats
path: root/priv
diff options
context:
space:
mode:
authorLuis Rascão <[email protected]>2016-10-27 19:20:52 +0100
committerGitHub <[email protected]>2016-10-27 19:20:52 +0100
commitcfd99cfc9e99b8a90a92459794bd6dabfd649d9b (patch)
tree06becbf7145b7c87960fbdb3264d25b5a4a33cca /priv
parent3ecc5c8a054fb4bf5515848d572b201fc2f5d13a (diff)
parent602f866a10039a79ef86edbf168762ebb435a2d4 (diff)
downloadrelx-cfd99cfc9e99b8a90a92459794bd6dabfd649d9b.tar.gz
relx-cfd99cfc9e99b8a90a92459794bd6dabfd649d9b.tar.bz2
relx-cfd99cfc9e99b8a90a92459794bd6dabfd649d9b.zip
Merge pull request #531 from lrascao/fix/console_clean
Give code path access to console_clean
Diffstat (limited to 'priv')
-rwxr-xr-xpriv/templates/extended_bin15
1 files changed, 14 insertions, 1 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index e844e46..ddecc8b 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -89,6 +89,16 @@ relx_start_command() {
"$START_OPTION"
}
+relx_get_code_paths() {
+ code="{ok, [{release,_,_,Apps}]} = file:consult(\"$REL_DIR/$REL_NAME.rel\"),"\
+"lists:foreach(fun(A) ->"\
+" io:fwrite(\"$ROOTDIR/lib/~p-~s/ebin \", [element(1, A), element(2, A)]) "\
+"end, Apps),"\
+"halt()."
+
+ "$BINDIR/erl" -noshell -boot start_clean -eval "$code"
+}
+
# Use $CWD/vm.args if exists, otherwise releases/VSN/vm.args
if [ -z "$VMARGS_PATH" ]; then
if [ -f "$RELEASE_ROOT_DIR/vm.args" ]; then
@@ -346,6 +356,7 @@ case "$1" in
;;
console|console_clean|console_boot)
+ __code_paths=""
# .boot file typically just $REL_NAME (ie, the app name)
# however, for debugging, sometimes start_clean.boot is useful.
# For e.g. 'setup', one may even want to name another boot script.
@@ -358,6 +369,7 @@ case "$1" in
fi
;;
console_clean)
+ __code_paths=$(relx_get_code_paths)
BOOTFILE="$ROOTDIR/bin/start_clean"
;;
console_boot)
@@ -381,7 +393,8 @@ case "$1" in
set -- "$BINDIR/erlexec" -boot "$BOOTFILE" -mode "$CODE_LOADING_MODE" \
-boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
-config "$RELX_CONFIG_PATH" \
- -args_file "$VMARGS_PATH"
+ -args_file "$VMARGS_PATH" \
+ -pa ${__code_paths}
# Dump environment info for logging purposes
echo "Exec: $@" -- ${1+$ARGS}