aboutsummaryrefslogtreecommitdiffstats
path: root/priv
diff options
context:
space:
mode:
Diffstat (limited to 'priv')
-rwxr-xr-xpriv/templates/extended_bin14
1 files changed, 8 insertions, 6 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index daa071b..0381964 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -233,14 +233,16 @@ replace_os_vars() {
escript_emulator_args() {
if [ -n "${VM_ARGS}" ]; then
if grep -q '%%!' $1; then
- cmd=$(echo sed -i"' '" "'/%%!.*/ s| ${VM_ARGS}||'" $1)
+ cmd=$(echo sed -i"'.prev'" "'/%%!.*/ s| ${VM_ARGS}||'" $1)
eval "$cmd"
- cmd=$(echo sed -i"' '" "'/%%!.*/ s|$| ${VM_ARGS}|'" $1)
+ cmd=$(echo sed -i"'.prev'" "'/%%!.*/ s|$| ${VM_ARGS}|'" $1)
eval "$cmd"
+ rm ${1}.prev
else
- cmd=$(echo sed -i"' '" "'/#!.*/ a \\
+ cmd=$(echo sed -i"'.prev'" "'/#!.*/ a \\
%%! ${VM_ARGS}\n'" $1)
eval "$cmd"
+ rm ${1}.prev
fi
fi
}
@@ -350,6 +352,9 @@ ERTS_LIB_DIR="$(dirname "$ERTS_DIR")/lib"
VMARGS_PATH=$(add_path vm.args $VMARGS_PATH)
+VMARGS_PATH=$(check_replace_os_vars vm.args $VMARGS_PATH)
+RELX_CONFIG_PATH=$(check_replace_os_vars sys.config $RELX_CONFIG_PATH)
+
# Check vm.args and other files referenced via -args_file parameters for:
# - nonexisting -args_files
# - circular dependencies of -args_files
@@ -435,9 +440,6 @@ esac
# Export the variable so that it's available in the 'eval' calls
export NAME
-VMARGS_PATH=$(check_replace_os_vars vm.args $VMARGS_PATH)
-RELX_CONFIG_PATH=$(check_replace_os_vars sys.config $RELX_CONFIG_PATH)
-
# Make sure log directory exists
mkdir -p "$RUNNER_LOG_DIR"